function left()
  turtle.turnLeft()
  turtle.dig()
  turtle.forward()
  turtle.turnLeft()
end

function right()
  turtle.turnRight()
  turtle.dig()
  turtle.forward()
  turtle.turnRight()
end

function go()
  for i=1,27 do
    turtle.dig()
    turtle.forward()
  end
end

function turn(asdf)
  if asdf == nil then
    if right == true then
      right()
    else
      left()
    end
    go()
  end
end


if (...) == "right" then
  right = true
else
  right = false
end

while true do
  turn()
end  
