Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fake_x,fake_y = 1,0
- x,y = -13,10
- delta = {1,0}
- function spiral()
- local pos = {true,true}
- pos[1] = fake_x
- pos[2] = fake_y
- if fake_x == fake_y or (fake_x < 0 and fake_x == -fake_y) or (fake_x > 0 and fake_x == 1-fake_y) then
- delta = {-delta[2], delta[1]}
- end
- fake_x = fake_x + delta[1]
- fake_y = fake_y + delta[2]
- print(fake_x .. " F " .. fake_y)
- print(delta[1] .. " D " .. delta[2])
- return pos
- end
- local newLocation
- newLocation = spiral()
- print(x + newLocation[1] .. " R " .. y + newLocation[2])
- sleep(1)
- newLocation = spiral()
- print(x + newLocation[1] .. " R " .. y + newLocation[2])
- sleep(1)
- newLocation = spiral()
- print(x + newLocation[1] .. " R " .. y + newLocation[2])
- sleep(1)
- newLocation = spiral()
- print(x + newLocation[1] .. " R " .. y + newLocation[2])
- sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement