A CellularAutomaton written in Scala
Scala
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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>