Skip to content

Instantly share code, notes, and snippets.

@dmberry
Forked from dmberry/vee.rb
Created February 11, 2012 18:57
Show Gist options
  • Save dmberry/1803563 to your computer and use it in GitHub Desktop.
Save dmberry/1803563 to your computer and use it in GitHub Desktop.
Reimplemented Annette Vee's 'This is good code' example
# ------------------------------------------------------
#
# Reimplementation of Annette Vee's 'This is good code' example
#
# The program generates a random positioned text line.
# Based on the original LOGO code by Annette Vee
#
# Written by David M. Berry
# 11 February 2012
#
# For the Critical Code Workshop 2012
#
# Written in Zajal ( http://zajal.cc )
#
# ------------------------------------------------------
# ------------------------------------------------------
# Here be arrays
# ------------------------------------------------------
array_x = []
array_y = []
# ------------------------------------------------------
# Here be colour variables red, green, blue
# ------------------------------------------------------
r = 255
g = 255
b = 255
# ------------------------------------------------------
# Here be DRAW LOOP
# ------------------------------------------------------
draw do
color r, g, b
15.times do |n|
text "This is good code", array_x[n], array_y[n]
end
end
# ------------------------------------------------------
# Here be MOUSE PRESSED LOOP
# ------------------------------------------------------
mouse_pressed do
array_x = []
array_y = []
r = rand(255)
g = rand(255)
b = rand(255)
15.times do
array_x << rand(300)
array_y << rand(500)
end
end
# ------------------------------------------------------
# Here be THE END
# ------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment