Advertisement
asweigart

stairbuilder

Aug 1st, 2016
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. -- Stair Builder program
  2. -- By Al Sweigart
  3. -- al@inventwithpython.com
  4. -- Builds stairs. Use with stair miner.
  5.  
  6. os.loadAPI('hare')
  7.  
  8. while turtle.detect() do
  9. turtle.up()
  10. if not hare.selectItem('stairs') then
  11. print('Need more stairs. Stopping.')
  12. return
  13. end
  14. turtle.placeDown()
  15. if not turtle.forward() then
  16. print('Hit wall. Stopping.')
  17. return
  18. end
  19. end
  20.  
  21. print('Reached end of incline. Stopping.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement