Skip to content

thestoneage/CellularAutomaton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

A CellularAutomaton written in Scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages