Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A CellularAutomaton written in Scala
Scala
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
ConwaysGameOfLife.scala
ElementaryCellularAutomaton.scala
README
demo.scala

README

Implementation of an Elementary Cellular Automaton written in Scala.
All 256 Elementary Automata are supported and can be created using their Wolfram Code.

Example:
// Create the 184 Automaton with an initial State
val initialState = List(false, true, false)
val automaton = ElementaryCellularAutomaton(184, initialStateAsList)

// Create an infinite collection of the automaton's evolution
val stream = ElementaryCellularAutomaton.evolve(automaton)

// Print the first 4 generations of a the automaton
stream.take(4).foreach(println _)
-+-
--+
+--
-+-

There is also a simple commandline driver named 'demo'. For the 
equivalent of the above example, try:

    # scala demo 184 010 4

That is:

    # scala demo <Wolfram Code> <initial state> <#iterations>
Something went wrong with that request. Please try again.