Advertisement
Guest User

dance1

a guest
Apr 4th, 2020
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local isUp = false
  2. local isBack = false
  3. local danceMove
  4. while true do
  5. danceMove = math.random(1, 5)
  6. if danceMove == 1 then
  7.    print('Turn to the left!')
  8.    turtle.turnLeft()
  9. elseif danceMove == 2 then
  10.    turtle.turnRight()
  11. elseif danceMove == 3 then
  12.    if isBack then
  13.      turtle.forward()
  14.      isBack = false
  15.      
  16.    else
  17.      turtle.back()
  18.      isBack = true
  19.    end
  20. elseif danceMove == 4 then
  21.    if isUp then
  22.      turtle.down()
  23.      isUp = false
  24.    else
  25.      print('Get up!')
  26.      turtle.up()
  27.      isUp = true
  28.    end
  29. else
  30.  
  31. for i = 1, 4 do
  32.     turtle.turnLeft()
  33. end
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement