A toolkit for creating and using Lindenmayer Systems.
Version control revision
Package version
Declare a new L-System that is configured via the given block
.
# File lib/l_system.rb, line 26
def self::declare( &block )
return LSystem::RulesEngine.new( &block )
end
Run a rules_engine
at most the given number of iterations
using the productions declared in the block
, which runs in the context of an anonymous LSystem::ProductionAdapter
class.
# File lib/l_system.rb, line 34
def self::run( rules_engine, iterations=1000, &block )
raise LocalJumpError, "no block given" unless block
adapter = Class.new( LSystem::ProductionAdapter, &block )
return adapter.new.run( rules_engine, iterations )
end