Skip to content

Instantly share code, notes, and snippets.

@timrandg
Created February 5, 2012 05:56
Show Gist options
  • Select an option

  • Save timrandg/1743317 to your computer and use it in GitHub Desktop.

Select an option

Save timrandg/1743317 to your computer and use it in GitHub Desktop.
# This sketch demonstrates how to use
# Ruby-Processing.
def setup
size 450, 450
smooth
background 255
end
def draw
grid(30,30,10,[0,0],[200,200,255])
grid(4,10,10,[30,30],[50,50,50])
grid(14,8,10,[60,50],[200,160,0])
end
def grid(r,c,size,transpose=[0,0],colors=[100,100,100])
fill *colors
start_x,y = transpose
width,height = size,size
#stroke = 200
r.times do
x = start_x
c.times do
rect x,y,width,height
x += width
end
y += height
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment