-
-
Save dmberry/1803563 to your computer and use it in GitHub Desktop.
Reimplemented Annette Vee's 'This is good code' example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------ | |
# | |
# 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