Advertisement
manuwwa

piramida

Apr 14th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1.  
  2. function postaw(x) --funkcja do stawiania pod robotem
  3. turtle.select(x)
  4.         turtle.digDown()
  5.         turtle.placeDown()
  6.         end
  7. function scieszka(a,z) --ruch po prostej i stawianie ponizej
  8. while(a>0)
  9.         do
  10.             if(z<17)
  11.             then
  12.                    
  13.             while ((turtle.getItemCount(z))==0)
  14.                     do
  15.                     z=z+1
  16.                     end
  17.             postaw(z)
  18.             end
  19.         np()
  20.         a=a-1
  21.         end
  22. end
  23. function np()
  24. while(turtle.forward()==false) --funkcja na przud z sprawdzaniem mozliwosci przejscia
  25.         do
  26.         turtle.dig()
  27.         end
  28. end
  29. function up()
  30.  
  31. while(turtle.up()==false)
  32. do
  33.  turtle.digUP()
  34.         end
  35. end
  36.  
  37. function kwadrat(x)
  38. z=4
  39. a=1
  40. while(z>0)
  41. do
  42.  
  43. scieszka(x,a)
  44. turtle.turnRight()
  45. z=z-1
  46. end
  47. end
  48.  
  49. x=17  --dlugosc i szerokosc piramidy
  50. up()
  51. kwadrat(x)
  52. up()
  53. while (x>1)
  54. do
  55. kwadrat(x)
  56. x=x-2
  57. np()
  58. turtle.turnRight()
  59. np()
  60. turtle.turnLeft()
  61. up()
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement