Guest User

yes

a guest
Feb 15th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. x = 0
  4. y = 0
  5. function rd()
  6.  x, y = x + 1, y + 1
  7.  sleep(0.1)
  8.  term.setCursorPos(x,y)
  9.  write("O")
  10. end
  11. function ru()
  12.  x, y = x + 1, y - 1
  13.  sleep(0.1)
  14.  term.setCursorPos(x,y)
  15.  write("O")
  16. end
  17. function ld()
  18.  x, y = x - 1, y + 1
  19.  sleep(0.1)
  20.  term.setCursorPos(x,y)
  21.  write("O")
  22. end
  23. function lu()
  24.  x, y = x - 1, y - 1
  25.  sleep(0.1)
  26.  term.setCursorPos(x,y)
  27.  write("O")
  28. end
  29.  
  30. while true do
  31.     repeat
  32.         if y == 18 then
  33.             repeat
  34.             rd()
  35.             until y == 1 or x == 50
  36.         end
  37.         if y == 1 then
  38.             repeat
  39.             ru()
  40.             until y == 18 or x == 50
  41.         end
  42.     until x == 50
  43.     repeat
  44.         if y < 18 then
  45.             repeat
  46.             ld()
  47.             until y == 1 or x == 1
  48.         end
  49.         if y > 1 then
  50.             repeat
  51.             lu()
  52.             until y == 18 or x == 1
  53.         end
  54.     until x == 1
  55. end
Advertisement
Add Comment
Please, Sign In to add comment