Created
February 19, 2017 07:45
-
-
Save yasyf/8c01c28ec45a2a14b30f8cda3484e644 to your computer and use it in GitHub Desktop.
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
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; | |
} | |
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
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