A collection of algorithms for generating cellular automata. Currently only contains “elementary cellular automata” or aka the cool pictures from the Wolfram book.
-
Provides a Automata::Elementary class that takes rule number, initial state along with a #run(steps) method.
-
Produces an Array of Strings as a result.
gem install ugly.automata
Requires ruby 1.9. Tested with:
-
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]
-
jruby 1.6.4 (ruby-1.9.2-p136) (2011-08-23 17ea768) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]
require 'automata' automaton = Automata::Elementary.new(110) automaton.run(2000)
-
Michael Garriss <mgarriss at gmail.com>
-
The elegantly simple algorithm and code for the elementary automata is from Jesse Merriman written for Ruby Quiz 134: Cellular Automata. see: www.rubyquiz.com/quiz134.html
Apache 2.0, See the file LICENSE
Copyright © 2011 Michael Garriss