Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- print("Wie oft soll ich Blumen sammeln?")
- write("Nenne eine Zahl: ")
- Anzahl = io.read() + 0
- Treibstoff = turtle.getFuelLevel() + 0
- -- Check ob genug Treibstoff da ist --
- Gesamtkosten = 26 * Anzahl
- if Gesamtkosten >= Treibstoff then
- print("Dafuer reicht mein Treibstoff nicht.")
- return
- end
- -- Funktion --
- function Vor( ZAHL , RICHTUNG )
- for i = 1,ZAHL do
- turtle.dig()
- turtle.forward()
- end
- if RICHTUNG == "L" then
- turtle.turnLeft()
- elseif RICHTUNG == "R" then
- turtle.turnRight()
- end
- end
- -- Basisprogramm --
- for i =1,Anzahl do
- turtle.placeDown()
- turtle.digDown()
- turtle.down()
- Vor(2,"L")
- Vor(2,"L")
- Vor(4,"L")
- Vor(4,"L")
- Vor(4,"L")
- Vor(1,"L")
- Vor(3,"R")
- Vor(2,"R")
- Vor(1)
- turtle.dig()
- turtle.turnRight()
- Vor(1)
- turtle.up()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement