Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- -- Variablen Vergeben
- Richtung = "Hoch"
- print("Bitte nenne mir Hoehe und Breite!")
- print("Vorsicht ich laufe nach rechts.")
- print(" ")
- write("Farm-Hoehe betraegt: ")
- Lang = io.read() - 1
- Lang2 = Lang + 1
- term.setCursorPos(1,5)
- write("Farm-Breite ist: ")
- Breit = io.read()
- print(" ")
- print("Ich arbeite in 5 Sekunden!")
- sleep(5)
- -- Funktionen
- function Wechsel()
- if Richtung == "Hoch" then
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- Richtung = "Runter"
- elseif Richtung == "Runter" then
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- Richtung = "Hoch"
- end
- end
- -- Programm
- turtle.select(1)
- for i = 1,Breit do
- print("Ich bin in Reihe: "..i)
- if Richtung == "Hoch" then
- turtle.dig()
- turtle.place()
- for i = 1,Lang do
- turtle.up()
- turtle.dig()
- turtle.place()
- end
- Wechsel()
- elseif Richtung == "Runter" then
- turtle.dig()
- turtle.place()
- for i = 1,Lang do
- turtle.down()
- turtle.dig()
- turtle.place()
- end
- Wechsel()
- end
- end
- if Richtung == "Runter" then
- for i = 1,Lang do
- turtle.down()
- end
- end
- print("Ich laufe Nachhause")
- turtle.turnLeft()
- for i = 1,Breit do
- turtle.forward()
- end
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement