Advertisement
TeoremaPi

Crear pasillo

Mar 22nd, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. -- distancia maxima hacia delante
  2. longMaxLado = 10
  3. -- distancia maxima hacia la derecha
  4. anchMaxLado = 7
  5. anchoPasillo = 3
  6.  
  7. turtle.select(1)
  8.  
  9.  
  10. for lado = 1, 4*anchoPasillo, 1 do
  11.  
  12.  if lado%2 == 0 then
  13.   longMax = anchMaxLado
  14.  else
  15.   longMax = longMaxLado
  16.  end
  17.  
  18.  if lado < 4 then
  19.   longLado = longMax
  20.  else
  21.   longLado = longMax - ((lado - 4)/2) - 1
  22.  end
  23.  
  24.  for x = 1, longLado, 1 do
  25.    
  26.   while (turtle.getItemCount() == 0) and (turtle.getSelectedSlot() < 16) do
  27.    turtle.select(turtle.getSelectedSlot() + 1)
  28.   end
  29.  
  30.   if (turtle.getItemCount() == 0) and (turtle.getSelectedSlot() == 16) then
  31.    break
  32.   end
  33.  
  34.   turtle.placeDown()
  35.   if x < longLado then
  36.    turtle.forward()
  37.   end
  38.  
  39.  end
  40.  turtle.turnRight()
  41.  
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement