Advertisement
Eco

lua line

Eco
Aug 26th, 2012
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. -- simple line program
  2. print "Hello! I will build a line by going forward and placing blocks under me!"
  3. print "Please put blocks in my first slot. (top left)"
  4.  
  5. function main()
  6. getInfo()
  7. line()
  8. end
  9.  
  10. function getInfo()
  11.  
  12. print "How long do you want your line?"
  13. x = tonumber(io.read())
  14.  
  15. if x < 100 then
  16. print "starting line!"
  17. -- else if x > 100 then
  18. -- print "Number must be less then 100"
  19. else
  20. print "Uhoh, what happened?"
  21. end
  22.  
  23. end
  24.  
  25.  
  26. function line()
  27.  
  28. -- for i=0, MAX, Increment
  29. for i=0,x do
  30. turtle.forward()
  31. turtle.placeDown()
  32. print(i)
  33. end
  34.  
  35. end
  36.  
  37.  
  38. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement