Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- print ("@Version: 1_1_4a")
- print ("@author: Kevin Iselborn")
- sleep (2)
- function getNumericVariable (Text)
- input = 1
- shell.run("clear")
- print (Text)
- input = read()
- while not tonumber(input) do
- print ("Du darfst nur Zahlen eingeben...Bitte versuche es erneut.")
- print (Text)
- input = read()
- end
- return input
- end
- width = getNumericVariable ("Wie Lang sind diese Reihen?")
- length = getNumericVariable ("Wie viele Reihen sollen abgebaut werden?")
- function digAndForward()
- turtle.dig()
- turtle.forward()
- end
- function mineRow ()
- i = 0
- while i<length do
- digAndForward()
- i=i+1
- end
- end
- function changeRow ()
- turtle.turnRight()
- turtle.turnRight()
- mineRow()
- turtle.turnLeft()
- digAndForward()
- turtle.turnLeft()
- end
- function mine ()
- k=0
- while k<width do
- mineRow()
- changeRow()
- k=k+1
- end
- end
- mine()
- print("finished")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement