<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,18 +2,18 @@
 # contextfreeart.org
 
 module Processing
-  
+
   class ContextFree
-    
+
     include Processing::Proxy
-    
+
     attr_accessor :rules, :app
-    
+
     AVAILABLE_OPTIONS = [:x, :y, :rotation, :size, :flip, :color, :hue, :saturation, :brightness, :alpha]
     HSB_ORDER         = {:hue =&gt; 0, :saturation =&gt; 1, :brightness =&gt; 2, :alpha =&gt; 3}
     TRIANGLE_TOP      = -1 / Math.sqrt(3)
     TRIANGLE_BOTTOM   = Math.sqrt(3) / 6
-    
+
     # Define a context-free system. Use this method to create a ContextFree
     # object. Call render() on it to make it draw.
     def self.define(&amp;block)
@@ -21,8 +21,8 @@ module Processing
       cf.instance_eval &amp;block
       cf
     end
-    
-    
+
+
     # Initialize a bare ContextFree object with empty recursion stacks.
     def initialize
       @app          = $app
@@ -32,8 +32,8 @@ module Processing
       @rewind_stack = []
       @matrix_stack = []
     end
-    
-    
+
+
     # Create an accessor for the current value of every option. We use a values
     # object so that all the state can be saved and restored as a unit.
     AVAILABLE_OPTIONS.each do |option_name|
@@ -41,13 +41,13 @@ module Processing
         @values[option_name]
       end
     end
-    
-    
-    # Here's the first serious method: A Rule has an 
-    # identifying name, a probability, and is associated with 
-    # a block of code. These code blocks are saved, and indexed 
+
+
+    # Here's the first serious method: A Rule has an
+    # identifying name, a probability, and is associated with
+    # a block of code. These code blocks are saved, and indexed
     # by name in a hash, to be run later, when needed.
-    # The method then dynamically defines a method of the same 
+    # The method then dynamically defines a method of the same
     # name here, in order to determine which rule to run.
     def rule(rule_name, prob=1, &amp;proc)
       @rules[rule_name] ||= {:procs =&gt; [], :total =&gt; 0}
@@ -70,8 +70,8 @@ module Processing
         end
       end
     end
-    
-    
+
+
     # Rule choice is random, based on the assigned probabilities.
     def determine_rule(rule_name)
       rule = @rules[rule_name]
@@ -79,8 +79,8 @@ module Processing
       pick = @rules[rule_name][:procs].select {|the_proc| the_proc[0].include?(chance) }
       return pick.flatten
     end
-    
-    
+
+
     # At each step of the way, any of the options may change, slightly.
     # Many of them have different strategies for being merged.
     def merge_options(old_ops, new_ops)
@@ -109,9 +109,9 @@ module Processing
         end
       end
     end
-    
-    
-    # Using an unknown key let's you set arbitrary values, 
+
+
+    # Using an unknown key let's you set arbitrary values,
     # to keep track of for your own ends.
     def merge_unknown_key(key, value, old_ops)
       key_s = key.to_s
@@ -126,9 +126,9 @@ module Processing
         end
       end
     end
-    
-    
-    # Doing a 'split' saves the context, and proceeds from there, 
+
+
+    # Doing a 'split' saves the context, and proceeds from there,
     # allowing you to rewind to where you split from at any moment.
     def split(options=nil, &amp;block)
       save_context
@@ -136,35 +136,35 @@ module Processing
       yield
       restore_context
     end
-       
-    
-    # Saving the context means the values plus the coordinate matrix. 
+
+
+    # Saving the context means the values plus the coordinate matrix.
     def save_context
       @rewind_stack.push @values.dup
       @matrix_stack &lt;&lt; @graphics.get_matrix
     end
-    
-    
+
+
     # Restore the values and the coordinate matrix as the recursion unwinds.
     def restore_context
-      @values = @rewind_stack.pop      
+      @values = @rewind_stack.pop
       @graphics.set_matrix @matrix_stack.pop
     end
-    
-    
+
+
     # Rewinding goes back one step.
     def rewind
       @finished = false
       restore_context
       save_context
     end
-    
-    
-    # Render the is method that kicks it all off, initializing the options 
+
+
+    # Render the is method that kicks it all off, initializing the options
     # and calling the first rule.
     def render(rule_name, starting_values={})
-      @values = {:x =&gt; 0, :y =&gt; 0, 
-                 :rotation =&gt; 0, :flip =&gt; false, 
+      @values = {:x =&gt; 0, :y =&gt; 0,
+                 :rotation =&gt; 0, :flip =&gt; false,
                  :size =&gt; 20, :width =&gt; 20, :height =&gt; 20,
                  :start_x =&gt; width/2, :start_y =&gt; height/2,
                  :color =&gt; [0.5, 0.5, 0.5, 1],
@@ -179,8 +179,8 @@ module Processing
       @app.translate @values[:start_x], @values[:start_y]
       self.send(rule_name, {})
     end
-    
-    
+
+
     # Before actually drawing the next step, we need to move to the appropriate
     # location.
     def get_ready_to_draw
@@ -188,8 +188,8 @@ module Processing
       sign = (@values[:flip] ? -1 : 1)
       @app.rotate(sign * @values[:rotation])
     end
-    
-    
+
+
     # Compute the rendering parameters for drawing a shape.
     def get_shape_values(some_options)
       old_ops = @values.dup
@@ -197,16 +197,16 @@ module Processing
       @app.fill *old_ops[:color]
       return old_ops[:size], old_ops
     end
-    
-    
+
+
     # Square, circle, and ellipse are the primitive drawing
     # methods, but hopefully triangles will be added soon.
     def square(some_options=nil)
       size, options = *get_shape_values(some_options)
       @app.rect(0, 0, size, size)
     end
-    
-    
+
+
     def circle(some_options=nil)
       size, options = *get_shape_values(some_options)
       @app.ellipse(0, 0, size, size)
@@ -219,8 +219,8 @@ module Processing
       @app.triangle(0, TRIANGLE_TOP * size, 0.5 * size, TRIANGLE_BOTTOM * size, -0.5 * size, TRIANGLE_BOTTOM * size)
       @app.rotate(-rot) if rot
     end
-    
-    
+
+
     def ellipse(some_options={})
       rot = some_options[:rotation]
       @app.rotate(rot) if rot
@@ -231,7 +231,7 @@ module Processing
       @app.rotate(-rot) if rot
     end
     alias_method :oval, :ellipse
-    
+
   end
-  
+
 end</diff>
      <filename>context_free.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>samples/levy.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>4c94f7ff403207c32244e0e224d7f7610f155c93</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Ashkenas</name>
    <email>jashkenas@gmail.com</email>
  </author>
  <url>http://github.com/jashkenas/context_free/commit/ed79110f3a4387600f264bb47ab1f317ec1d4fdd</url>
  <id>ed79110f3a4387600f264bb47ab1f317ec1d4fdd</id>
  <committed-date>2009-11-08T12:40:29-08:00</committed-date>
  <authored-date>2009-11-08T12:40:29-08:00</authored-date>
  <message>merging monkstone and whitespace</message>
  <tree>6be065deaf1c553dfdf3aee7033e870f4688d961</tree>
  <committer>
    <name>Jeremy Ashkenas</name>
    <email>jashkenas@gmail.com</email>
  </committer>
</commit>
