module LSystem
A toolkit for creating and using Lindenmayer Systems.
Constants
- REVISION
Version control revision
- VERSION
Package version
Public Class Methods
declare( &block )
click to toggle source
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( rules_engine, iterations=1000, &block )
click to toggle source
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