Skip to content

Instantly share code, notes, and snippets.

@jamorton
Created January 31, 2012 22:52
Show Gist options
  • Save jamorton/1713593 to your computer and use it in GitHub Desktop.
Save jamorton/1713593 to your computer and use it in GitHub Desktop.
#--------------------------------
# A simple language, one step above Scratch.
#--------------------------------
tom = Sprite "cat.png"
when start
move tom 10
end
when tom:x > 5
if tom:x is 7
output "it's 7!"
end
flip tom
end
loop i to 5
output i
end
#---------------------------------
# how this would be compiled to javascript
#---------------------------------
var tom = new Sprite("Cat.png");
Event.add(
new Event.start(),
function() {
Global.move(tom, 10);
}
);
Event.add(
new Event.expr(function() {
return tom.x > 5;
}),
function() {
Global.output(tom.x);
}
);
for (var i = 0; i < 5; i++)
Global.output(i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment