Skip to content

Instantly share code, notes, and snippets.

@yasyf
Created February 19, 2017 07:45
Show Gist options
  • Save yasyf/8c01c28ec45a2a14b30f8cda3484e644 to your computer and use it in GitHub Desktop.
Save yasyf/8c01c28ec45a2a14b30f8cda3484e644 to your computer and use it in GitHub Desktop.
p = {x:0; y:0;};
im = fun(x y){
if(x==p.x & y==p.y){
return "x";
}
return " ";
};
i = 0;
while(i < 30){
consolePrint(im, 30, 30);
p.x = i;
p.y = i;
i = i+1;
}
Program
-------
Block {
Assignment
p = Record
x : 0
y : 0
;
Assignment
im = Function(x, y)
Block {
IfStatement
If[((x) == (p.x)) & ((y) == (p.y))] {
Block {
Return
"x"
}
}
Return
" "
}
;
Assignment
i = 0;
WhileLoop
While[(i) < (30)] {
Block {
Call[consolePrint]
im
30
30
Assignment
p.x = i;
Assignment
p.y = i;
Assignment
i = (i) + (1);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment