Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local isUp = false
- local isBack = false
- local danceMove
- while true do
- danceMove = math.random(1, 5)
- if danceMove == 1 then
- print('Turn to the left!')
- turtle.turnLeft()
- elseif danceMove == 2 then
- turtle.turnRight()
- elseif danceMove == 3 then
- if isBack then
- turtle.forward()
- isBack = false
- else
- turtle.back()
- isBack = true
- end
- elseif danceMove == 4 then
- if isUp then
- turtle.down()
- isUp = false
- else
- print('Get up!')
- turtle.up()
- isUp = true
- end
- else
- for i = 1, 4 do
- turtle.turnLeft()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement