diff --git a/src/brulijam/t-farmer.lua b/src/brulijam/t-farmer.lua index fb6e6b8..f472caf 100644 --- a/src/brulijam/t-farmer.lua +++ b/src/brulijam/t-farmer.lua @@ -23,55 +23,49 @@ local function selectSeed() end +local function doField() + turtle.up() - -turtle.up() - ---do 2 rows of fields -for i=1, 2 do - --do 3 rows - for j=1, 3 do - --do one row - for k=1, 2 do - for l=1, 3 do - turtle.forward() - local blockFound, blockData = turtle.inspectDown() - if blockFound then - turtle.digDown() - turtle.suckDown() - selectSeed() - turtle.placeDown() + --do 2 rows of fields + for i=1, 2 do + --do 3 rows + for j=1, 3 do + --do one row + for k=1, 2 do + for l=1, 3 do + turtle.forward() + local blockFound, blockData = turtle.inspectDown() + if blockFound then + turtle.digDown() + turtle.suckDown() + selectSeed() + turtle.placeDown() + end end + turtle.forward() + end + -- move to next row + if i%2==1 then + turtle.turnRight() + turtle.forward() + turtle.turnRight() + else + turtle.turnLeft() + turtle.forward() + turtle.turnLeft() end - turtle.forward() - end - -- move to next row - if i%2==1 then - turtle.turnRight() - turtle.forward() - turtle.turnRight() - else - turtle.turnLeft() - turtle.forward() - turtle.turnLeft() end + turtle.turnLeft() + turtle.forward() + turtle.turnRight() end - turtle.turnLeft() - turtle.forward() - turtle.turnRight() end - - - - - - local function main() - + doField() end