2014-01-12 13:50:41 +07:00

27 lines
520 B
OpenEdge ABL

@keypressed(key)
{
/* get current position */
new x, y
wherexy x, y
/* determine how the update the current position */
switch (key)
{
case 'u': y-- /* up */
case 'd': y++ /* down */
case 'l': x-- /* left */
case 'r': x++ /* right */
case '\e': exit /* Escape = exit */
}
/* adjust the cursor position and draw something */
moveturtle x, y
}
moveturtle(x, y)
{
gotoxy x, y
print '*'
gotoxy x, y
}