Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local location = {}
- local position = {}
- local size ={}
- local maxNum = 0
- function main()
- position[0] = -1
- position[1] = -1
- position[2] = -1
- print("Reihe,Stapel,Platz")
- size[0] = read()
- size[1] = read()
- size[2] = read()
- maxNum = size[0]*size[1]*size[2]
- for i=, maxNum-1 do
- location[i]="Nil"
- end
- while true do
- print("e:Zum Einlagern a:Zum Auslagern")
- local input = read()
- if input == "e" then
- print("Name in Kleinbuchstaben:")
- input = read()
- local place = -1
- for i=0 maxNum-1 do
- if location[i] == input then
- place = i
- end
- end
- if place == -1 then
- for i=0 maxNum-1 do
- if location[i] == "Nil" then
- place = i
- end
- end
- end
- if place == -1 then
- print("Das Lager ist Voll")
- else
- local r = 0
- local s = 0
- local p = 0
- if place >= 12 then
- r = math.floor(place/size[0])
- place = place - size[0]*r
- end
- if place >=3 then
- s = math.floor(place/3)
- place = place -
- end
- elseif input == "a" then
- reset()
- end
- end
- end
- function move(pReihe,pStapel,pPlatz)
- for i = 0, pReihe do
- turtle.forward()
- turtle.forward()
- end
- turtle.turnRight()
- for i = 0, pStapel do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- end
- turtle.turnRight()
- for i = 0, pPlatz do
- turtle.up()
- turtle.up()
- end
- position[0] = pReihe
- position[1] = pStapel
- position[2] = pPlatz
- end
- function reset()
- if position[x] == -1 or position[y] == -1 or position[z] == -1 then
- return
- end
- for i = 0, position[2] do
- turtle.down()
- turtle.down()
- end
- turtle.turnRight()
- for i = 0, position[1] do
- turtle.forward()
- turtle.forward()
- turtle.forward()
- end
- turtle.turnLeft()
- for i = 0, position[0] do
- turtle.forward()
- turtle.forward()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement