Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local taille = ...
- local mode = false
- local sens = false
- if taille % 2 == 0 then
- mode = true
- end
- local emplacement = 1
- turtle.select(emplacement)
- local function verif()
- local inv = turtle.getItemCount(emplacement)
- if inv == 0 then
- turtle.select(emplacement+1)
- emplacement = emplacement+1
- end
- end
- local function av() while not turtle.forward() do end end
- local function rb() while not turtle.back() do end end
- local function mt() while not turtle.up() do end end
- local function ds() while not turtle.down() do end end
- local function ga() while not turtle.turnLeft() do end end
- local function dr() while not turtle.turnRight() do end end
- local function cr() turtle.dig() end
- local function ucr() turtle.digUp() end
- local function dcr() turtle.digDown() end
- local function p() turtle.place() end
- local function pu() turtle.placeUp() end
- local function pd() turtle.placeDown() end
- local function ss(s) turtle.select(s) end
- --cycle
- local i = 0
- while i < taille-1 do
- av()
- i=i+1
- end
- if not mode then
- while i < (tonumber(taille)-1) do
- av()
- i=i+1
- end
- else
- ga()
- end
- local i = 0
- repeat
- local j = 0
- repeat
- rb()
- verif()
- p()
- j = j+1
- until j == (tonumber(taille)-1)
- if sens then
- ga()
- sens = false
- else
- dr()
- sens = true
- end
- rb()
- verif()
- p()
- if sens then
- dr()
- else
- ga()
- end
- i=i+1
- until i == (tonumber(taille))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement