Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --{program="bHead",version="1.00",date="2013-12-07",basicFunc="1.11",basicFuncDate="2013-12-07",addFunc="1.00"",addFuncDate="2013-12-07"}
- ---------------------------------------
- -- buildHead by Kaikaku
- -- 2013-12-07, v1.00 initial
- ---------------------------------------
- -- basic functions: v1.11, 2013-12-07
- -- additional func: v1.00, 2013-12-07
- ---------------------------------------
- ---------------------------------------
- ---- PARAMETERS -----------------------
- ---------------------------------------
- local cSleepTime=10
- local cMinFuel=80
- local dispLine ="+-------------------------------------+"
- local dispEmpty="| |"
- local tColors={}
- tColors[1] ="white " tColors[2] ="orange" tColors[3] ="magent" tColors[4] ="lBlue"
- tColors[5] ="yellow" tColors[6] ="lime " tColors[7] ="pink " tColors[8] ="grey "
- tColors[9] ="lGrey " tColors[10]="cyan " tColors[11]="purple" tColors[12]="blue "
- tColors[13]="brown " tColors[14]="green " tColors[15]="red " tColors[16]="black"
- ---------------------------------------
- ---- VARIABLES ------------------------
- ---------------------------------------
- local inputMode = "h" --"v"
- local inputHead = 1
- local strHead=""
- local pat = {}
- local blnDone=false
- local countMats={}
- for i=1,16,1 do countMats[i]=" " end
- local strMessage=""
- local strInput=""
- local currentSlot=1
- local blnAskForParameters=true
- ---------------------------------------
- ---- tArgs ----------------------------
- ---------------------------------------
- local tArgs = {...}
- if #tArgs == 2 then -- no error check
- blnAskForParameters=false
- userA=tArgs[1]
- if userA~="v" then userA="h" end
- userB=tonumber(tArgs[2])
- elseif #tArgs ~= 0 then
- print("Usage: buildHead [(v/h) (head number)]")
- return
- end
- ---------------------------------------
- -- basic functions for turtle control -
- ---------------------------------------
- local function mats() -- without changing slots
- while turtle.getItemCount(currentSlot)==0 do
- print("Out of materials, pls restock slot "..currentSlot.."!")
- print(" Sleeping for "..cSleepTime.." sec ...")
- os.sleep(cSleepTime)
- end
- end
- local function gf() while not turtle.forward() do end end
- local function gb() while not turtle.back() do end end
- local function gu() while not turtle.up() do end end
- local function gd() while not turtle.down() do end end
- local function gl() while not turtle.turnLeft() do end end
- local function gr() while not turtle.turnRight() do end end
- local function df() turtle.dig() end
- local function du() turtle.digUp() end
- local function dd() turtle.digDown() end
- local function pf() mats() while not turtle.place() do end end
- local function pu() mats() while not turtle.placeUp() do end end
- local function pd() mats() while not turtle.placeDown() do end end
- local function sf() turtle.suck() end
- local function su() turtle.suckUp() end
- local function sd() turtle.suckDown() end
- local function Df() turtle.drop() end
- local function Du() turtle.dropUp() end
- local function Dd() turtle.dropDown() end
- local function ss(s) turtle.select(s) currentSlot=s end
- local function tp(slot) gb() ss(slot) pf() end
- local function tu(slot) gu() ss(slot) pd() end
- local function td(slot) gd() ss(slot) pu() end
- local function waitKey(strText)
- local event, scancode
- write(strText)
- event, scancode = os.pullEvent("key")
- print()
- end
- local function checkFuel()
- local tmp=turtle.getFuelLevel()
- return tmp
- end
- ---------------------------------------
- -- additional functions ---------------
- ---------------------------------------
- local function askForInputText(textt)
- local at=""
- -- check prompting texts
- if textt==nil then textt="Enter text:" end
- -- ask for input
- write(textt)
- at=read()
- return at
- end
- local function colorIf(intColor)
- local tmpStr="["..countMats[intColor].."]"
- if countMats[intColor]==" " then
- if (intColor==4) or (intColor==8) or (intColor==12) or (intColor==16) then
- tmpStr=tmpStr.." "
- else
- tmpStr=tmpStr.." "
- end
- else
- tmpStr=tmpStr..tColors[intColor]
- end
- return tmpStr
- end
- ------------------------------------------------------------------------------
- -- main ----------------------------------------------------------------------
- ------------------------------------------------------------------------------
- -- step 0 check preconditions
- term.clear() term.setCursorPos(1,1)
- -- step 0.1 turtle?
- local turtleOk, turtleVal = pcall(checkFuel)
- if not turtleOk then
- print(dispLine)
- print("| buildHead, by Kaikaku |")
- print(dispLine)
- print("| This is a turtle build program. |")
- print("| Please, execute it with a turtle! |")
- print(dispLine)
- return
- end
- -- step 0.2 fuel?
- if turtleVal<cMinFuel then
- print(dispLine)
- print("| buildHead, by Kaikaku |")
- print(dispLine)
- print("| Please refuel turtle, it needs a |")
- print("| minimum of ",cMinFuel," fuel units. |")
- print("| Tip: Put some fuel (e.g. coal) in |")
- print("| slot 1 and enter: refuel all. |")
- print("| This will consume all(!) fuel |")
- print("| items in the turtle's inventory|")
- print(dispLine)
- return
- end
- -- step 1 usage hints
- term.clear() term.setCursorPos(1,1)
- if blnAskForParameters then
- repeat
- print(dispLine)
- print("| buildHead, by Kaikaku |")
- print(dispLine)
- print("| With this turtle program you can |")
- print("| build different 8x8 heads. |")
- print("| 1) select mode: horizontal/vertical |")
- print("| 2) select a head |")
- print("| 3) put in required materials |")
- print("| 4) watch the turtle build :) |")
- print("| hint: turtle stops if sth. blocks |")
- print("| its way or runs out of materials.|")
- print(dispLine)
- until askForInputText("Press enter when ready:")==""
- end
- -- step 2 select vertical/horizontal
- if blnAskForParameters then
- repeat
- print(dispLine)
- print("| Please select mode: |")
- print(dispLine)
- print("| [h] horizontal build |")
- print("| [v] vertical build |")
- print(dispEmpty) print(dispEmpty) print(dispEmpty)
- print(dispEmpty) print(dispEmpty) print(dispEmpty)
- print(dispLine)
- inputMode=(askForInputText("Enter v or h:"))
- until inputMode=="h" or inputMode=="v" or inputMode==" h" or inputMode==" v"
- else
- inputMode=userA
- end
- -- step 3 select head and show mats required
- repeat
- blnDone=true
- if blnAskForParameters then
- print(dispLine)
- print("| Please select head: |")
- print(dispLine)
- print("| [1] creeper [9] pig |")
- print("| [2] zombie [10] sheep |")
- print("| [3] skeleton [11] cow |")
- print("| [4] wither skeleton [12] mooshroom |")
- print("| [5] ender man [13] octopus |")
- print("| [6] spider [14] z.pigman |")
- print("| [7] ghast [15] snow golem |")
- print("| [8] slime [16] iron golem |")
- print(dispLine)
- tmpHead=tonumber(askForInputText("Enter head number:"))
- else
- tmpHead=userB
- --print("User selected head "..tmpHead)
- end
- if tmpHead==1 then
- strHead="Creeper"
- pat={6,6,6,6,6,6,6,6,6,6,6,6,16,16,6,6,16,16,6,6,16,16,6,6,6,16,16,6,6,6,6,6,6,16,16,6,6,6,6,6,16,16,6,6,16,16,6,6,6,6,6,6,16,16,6,6,6,6,6,6,6,6,6,6}
- countMats[6] ="48" -- lime
- countMats[16]="16" -- black
- elseif tmpHead==2 then
- strHead="Zombie"
- pat={14,14,14,14,14,14,14,14,14,14,14,16,14,14,14,14,14,14,14,16,14,14,14,14,14,14, 8,14,14,14,14,14,14,14, 8,14,14,14,14,14,14,14,14,16,14,14,14,14,14,14,14,16,14,14,14,14,14,14,14,14,14,14,14,14}
- countMats[8] =" 2" -- grey
- countMats[14]="58" -- green
- countMats[16]=" 4" -- black
- elseif tmpHead==3 then
- strHead="Skeleton"
- pat={9,9,9,9,9,9,9,9,9,8,9,8,9,9,9,9,9,8,9,8,9,9,9,9,9,8,9,9,9,9,9,9,9,8,9,9,9,9,9,9,9,8,9,8,9,9,9,9,9,8,9,8,9,9,9,9,9,9,9,9,9,9,9,9}
- countMats[8] ="10" -- grey
- countMats[9] ="54" -- light grey
- elseif tmpHead==4 then
- strHead="Wither skeleton"
- pat={8,8,8,8,8,8,8,8,8,8,8,16,8,8,8,8,8,16,8,16,8,8,8,8,8,16,8,8,8,8,8,8,8,16,8,8,8,8,8,8,8,16,8,16,8,8,8,8,8,8,8,16,8,8,8,8,8,8,8,8,8,8,8,8}
- countMats[8] ="56" -- grey
- countMats[16]=" 8" -- black
- elseif tmpHead==5 then
- strHead="Ender man"
- pat={16,16,16, 7,16,16,16,16,16,16,16, 3,16,16,16,16,16,16,16, 7,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, 7,16,16,16,16,16,16,16, 3,16,16,16,16,16,16,16, 7,16,16,16,16}
- countMats[3] =" 2" -- magenta
- countMats[7] =" 4" -- pink
- countMats[16]="58" -- black
- elseif tmpHead==6 then
- strHead="Spider"
- pat={16,16, 8, 8,13,15, 8, 8, 8,16,16, 8,13,13, 8,16, 9, 9, 8,13,15, 8,16, 8,16,16, 8,13,13, 8, 8, 8, 8, 8, 8,13,15, 8, 8, 8, 9, 9, 8,13,13, 8,16, 8, 8,16,16, 8,13,15, 8,16,16,16, 9, 8,13,13, 8, 8}
- countMats[8] ="29" -- grey
- countMats[9] =" 5" -- light grey
- countMats[13]="12" -- brown
- countMats[15]=" 4" -- red
- countMats[16]="14" -- black
- elseif tmpHead==7 then
- strHead="Ghast"
- pat={ 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 9, 1, 8, 9, 1, 1, 8, 1, 1, 9, 8, 1, 9, 1, 8, 1, 1, 1, 9, 1, 1, 1, 8, 1, 1, 1, 9, 1, 1, 1, 8, 1, 1, 9, 8, 1, 9, 1, 9, 1, 9, 9, 8, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1}
- countMats[1] ="43" -- white
- countMats[8] =" 4" -- grey
- countMats[9] ="13" -- light grey
- elseif tmpHead==8 then
- strHead="Slime"
- pat={6,6,6,14,6,6,6,6,6,14,14,14,16,16,14,6,6,14,14,14,16,16,14,6,14,14,14,14,14,14,14,14,6,14,16,14,14,14,14,6,6,14,14,14,16,16,14,6,6,14,14,14,16,16,14,6,6,6,14,6,6,6,6,6}
- countMats[6] ="24" -- lime
- countMats[14]="31" -- green
- countMats[16]=" 9" -- black
- elseif tmpHead==9 then
- strHead="Pig"
- pat={ 7, 7, 7, 7,16, 7, 7, 7, 7, 7, 7, 7, 1, 7, 7, 7, 7, 9, 8, 9, 7, 7, 7, 7, 7, 9, 7, 9, 7, 7, 7, 7, 7, 9, 7, 9, 7, 7, 7, 7, 7, 9, 8, 9, 7, 7, 7, 7, 7, 7, 7, 7, 1, 7, 7, 7, 7, 7, 7, 7,16, 7, 7, 7}
- countMats[1] =" 2" -- white
- countMats[7] ="50" -- pink
- countMats[8] =" 2" -- grey
- countMats[9] =" 8" -- light grey
- countMats[16]=" 2" -- black
- elseif tmpHead==10 then
- strHead="Sheep"
- pat={ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8,16, 8, 9, 9, 9, 8, 8, 8, 1, 8, 9, 9, 9, 8, 7, 8, 8, 8, 9, 9, 9, 8, 7, 8, 8, 8, 9, 9, 9, 8, 8, 8, 1, 8, 9, 9, 9, 9, 9, 8,16, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}
- countMats[1] =" 2" -- white
- countMats[7] =" 2" -- pink
- countMats[8] ="20" -- grey
- countMats[9] ="38" -- light grey
- countMats[16]=" 2" -- black
- elseif tmpHead==11 then
- strHead="Cow"
- pat={13,13,13,13,16, 9,13,13, 1, 1,13,13, 1, 9,13,13, 9,16, 1,13,13,13,13,13, 8, 9, 1,13, 8, 9, 9, 9, 8, 9, 1,13,13, 9, 9, 9, 9,16, 1,13,13,13, 9, 8, 1, 1,13,13, 1, 9,13, 8,13,13,13,13,16, 9,13,13}
- countMats[1] ="10" -- white
- countMats[8] =" 5" -- grey
- countMats[9] ="15" -- light grey
- countMats[13]="30" -- brown
- countMats[16]=" 4" -- black
- elseif tmpHead==12 then
- strHead="Mooshroom"
- pat={15,15,15,15,16,16,15,15, 1, 1,15,15,16,16,15,15, 9,16, 1,15,15,15,15,15, 8, 9, 1,15, 8, 9, 9, 9, 8, 9, 1,15,15, 9, 9, 9, 9,16, 1,15,15,15, 9, 8, 1, 1,15,15,16,16,15, 8,15,15,15,15,16,16,15,15}
- countMats[1] =" 8" -- white
- countMats[8] =" 5" -- grey
- countMats[9] ="11" -- light grey
- countMats[15]="30" -- red
- countMats[16]="10" -- black
- elseif tmpHead==13 then
- strHead="Octopus"
- pat={12,12,12,12,12,12,12,12,12,12,12, 1,16,12,12,12,10,10, 4, 1, 1,10,12,12,10,10,10, 4, 4, 4,10,12, 4,10,10,10,10,10, 4,12,12, 4,10, 1, 1,10,12,12,12,12,12, 1,16,12,12,12,12,12,12,12,12,12,12,12}
- countMats[1] =" 6" -- white
- countMats[4] =" 7" -- light blue
- countMats[10]="14" -- cyan
- countMats[12]="35" -- blue
- countMats[16]=" 2" -- black
- elseif tmpHead==14 then
- strHead="Zombie pigman"
- pat={ 9, 6, 9, 9,16, 9, 9, 9, 6,14, 9, 9, 1, 9, 9, 6,14, 7, 8, 7, 9, 9, 6, 9, 6, 9, 6, 7,14, 9, 6,14, 6, 9, 6, 9, 7, 6,14,14,14, 9, 8, 9, 7, 7, 7, 7,14, 7, 7, 7, 1, 7, 7, 7,14,14, 7,14,16, 7, 7, 7}
- countMats[1] =" 2" -- white
- countMats[6] ="10" -- lime
- countMats[7] ="18" -- pink
- countMats[8] =" 2" -- grey
- countMats[9] ="19" -- light grey
- countMats[14]="11" -- green
- countMats[16]=" 2" -- black
- elseif tmpHead==15 then
- strHead="Snow golem"
- pat={ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,16,13, 2,16,13, 2, 2,13,16, 2, 2,16,16, 2, 2, 2,16,13, 2, 2, 2, 2, 2,13,16, 2, 2, 2, 2, 2, 2, 2,16,13, 2,16,16, 2, 2,13,16, 2, 2,16,13, 2, 2, 2, 2, 2, 2, 2, 2, 2}
- countMats[2] ="44" -- orange
- countMats[13]=" 8" -- brown
- countMats[16]="12" -- black
- elseif tmpHead==16 then
- strHead="Iron golem"
- pat={ 9, 9, 9, 9,13, 9, 8, 9, 9,13,15,16,13, 9, 8, 9, 9,13,16,16,13, 9, 8, 9, 8, 8, 8, 9,13, 9, 8, 9, 8, 8, 8, 9,13, 9, 8, 9, 9,13,16,16,13, 9, 8, 9, 9,13,15,16,13, 9, 8, 9, 9, 9, 9, 9,13, 9, 8, 9}
- countMats[8] ="14" -- grey
- countMats[9] ="30" -- light grey
- countMats[13]="12" -- brown
- countMats[15]=" 2" -- red
- countMats[16]=" 6" -- black
- elseif tmpHead==17 then
- strHead="Notch"
- pat={ 7, 7, 7, 7, 7, 7, 7, 7,16,16,16, 7, 7,16, 7, 7,16,16, 1,16, 7, 7, 7, 7,16,16, 1,16, 7, 7, 7, 7,16,16, 1,16, 7, 7, 7, 7,16,16, 1,16, 7, 7, 7, 7,16,16,16, 7, 7,16, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}
- countMats[1] =" 4" -- white
- countMats[7] ="40" -- pink
- countMats[16]="20" -- black
- elseif tmpHead==18 then
- strHead="Steve"
- pat={ 7, 7, 7, 7, 7,13,13,13, 7, 7, 7, 1, 7, 7,13,13,13,13, 7,12, 7, 7,13,13,13, 7,13, 7, 7, 7,13,13,13, 7,13, 7, 7, 7,13,13,13,13, 7,12, 7, 7,13,13, 7, 7, 7, 1, 7, 7,13,13, 7, 7, 7, 7, 7,13,13,13}
- countMats[1] =" 2" -- white
- countMats[7] ="34" -- pink
- countMats[12]=" 2" -- blue
- countMats[13]="26" -- brown
- elseif tmpHead==19 then
- strHead="Magma cube"
- pat={13,16,16,16,16,16, 8,16, 8,13,16,16, 2,15,16,16, 8, 8,16,16, 5,15,16, 8,13,16,16, 8,13,16, 8,13,16,16,13,13,16,16,13, 8,16, 8,13, 8, 5,15,13,13, 8,13,13,13, 2,15,16, 8, 8,13, 8,13,16,16,16,16}
- countMats[2] =" 2" -- orange
- countMats[5] =" 2" --yellow
- countMats[8] ="14" -- grey
- countMats[13]="16" -- brown
- countMats[15]=" 4" -- red
- countMats[16]="26" -- black
- elseif tmpHead==20 then
- strHead="Blaze"
- pat={13,15, 2, 5, 5, 2, 5, 5,15, 2, 5, 5, 1, 5, 5, 2,13,15, 2, 5,16, 5, 2, 5,15,13, 2, 2, 5, 5, 5, 2,13,15,13, 5, 2, 5, 5, 5,15,13, 2, 2,16, 5, 2, 5,13,15,13, 2, 1, 2, 5, 5,13,13,15, 2, 2,13, 2, 5}
- countMats[1] =" 2" -- white
- countMats[2] ="18" -- orange
- countMats[5] ="23" --yellow
- countMats[13]="11" -- brown
- countMats[15]=" 8" -- red
- countMats[16]=" 2" -- black
- elseif tmpHead==21 then
- strHead="Wither"
- pat={ 4,16,10,16, 4,16, 4,16,10,16,16, 1,10,16, 4,16, 1, 9,16, 1,16,16,10,16, 9, 1,16,16,16,16,16,16, 9, 1,16,16,16,16,16,16, 1, 9,16, 1,16,16,10,16,10,16,16, 1,10,16, 4,16, 4,16,10,16, 4,16, 4,16}
- countMats[1] =" 8" -- white
- countMats[4] =" 8" -- light blue
- countMats[9] =" 4" -- light grey
- countMats[10]=" 8" -- cyan
- countMats[16]="36" -- black
- else
- blnDone=false
- if not blnAskForParameters then
- print("Unknown head number: "..tmpHead)
- tmpHead=1
- print("Set default to: "..tmpHead)
- end
- end
- until blnDone
- -- step 4 display materials required
- if blnAskForParameters then
- repeat
- print(dispLine)
- print("| Put wool or equivalent in 4x4 grid: |")
- --print(dispLine)
- print("| Colors are sorted by block ID and |")
- print("| use same slots for all heads. |")
- print("| Required amount is put in []. |")
- print(dispLine)
- print(strHead..":")
- -- 4x4 material slots
- for i=1,16,4 do
- print(colorIf(i),colorIf(i+1),colorIf(i+2),colorIf(i+3))
- end
- print(strMessage) -- first time ""
- strMessage="" --reset
- strInput=askForInputText("Press enter when ready:")
- for i=1,16,1 do
- if countMats[i]~=" " then
- if turtle.getItemCount(i)<tonumber(countMats[i]) then
- strMessage=">>> Please, put "..countMats[i].." blocks in slot "..tostring(i).."!"
- break
- end
- end
- end
- until strInput=="" and strMessage==""
- end
- -- step 5 Build head
- -- random build order
- if inputMode==" v" or inputMode=="v" then
- -- vertical
- if math.random(2)==1 then
- -- build vertical 1
- gf() gu() tu(pat[2]) tu(pat[3]) tu(pat[4]) tu(pat[5]) tu(pat[6]) tu(pat[7]) gl()
- tp(pat[8]) tp(pat[16]) tp(pat[24]) tp(pat[32]) tp(pat[40]) tp(pat[48]) tp(pat[56])
- td(pat[64]) td(pat[63]) td(pat[62]) td(pat[61]) td(pat[60]) td(pat[59]) gl() td(pat[58])
- gl() tp(pat[57]) tp(pat[49]) tp(pat[41]) tp(pat[33]) tp(pat[25]) gl() tu(pat[17])
- gl() tp(pat[18]) tp(pat[26]) tp(pat[34]) tp(pat[42]) tu(pat[50]) tu(pat[51])
- tu(pat[52]) tu(pat[53]) gl() tu(pat[54]) gl() tp(pat[55]) tp(pat[47]) tp(pat[39])
- tp(pat[31]) tp(pat[23]) td(pat[15]) td(pat[14]) gl() td(pat[13]) gl() tp(pat[12])
- tu(pat[20]) tu(pat[21]) tp(pat[22]) tp(pat[30]) tp(pat[38]) td(pat[46])
- td(pat[45]) gl() td(pat[44]) gl() tp(pat[43]) tu(pat[35]) tu(pat[36]) tp(pat[37])
- td(pat[29]) td(pat[28]) tp(pat[27]) tp(pat[19]) td(pat[11]) td(pat[10]) tp(pat[9])
- gl() tp(pat[1])
- else
- -- build vertical 2
- gf() gr() gf() gf() gf() gf()gu() gu() gu() tu(pat[36]) tp(pat[37]) td(pat[29])
- gr() td(pat[28]) gr() tp(pat[27]) tp(pat[35]) tu(pat[43]) tu(pat[44]) gr() tu(pat[45])
- gr() tp(pat[46]) tp(pat[38]) tp(pat[30]) td(pat[22]) td(pat[21]) td(pat[20])
- gr() td(pat[19]) gr() tp(pat[18]) tp(pat[26]) tp(pat[34]) tp(pat[42])
- tu(pat[50]) tu(pat[51]) tu(pat[52]) tu(pat[53]) gr() tu(pat[54]) gr() tp(pat[55])
- tp(pat[47]) tp(pat[39]) tp(pat[31]) tp(pat[23]) td(pat[15]) td(pat[14]) td(pat[13])
- td(pat[12]) td(pat[11]) gr() td(pat[10]) gr() tp(pat[9]) tp(pat[17]) tp(pat[25])
- tp(pat[33]) tp(pat[41]) tp(pat[49]) tu(pat[57]) tu(pat[58]) tu(pat[59]) tu(pat[60])
- tu(pat[61]) tu(pat[62]) gr() tu(pat[63]) gr() tp(pat[64]) tp(pat[56]) tp(pat[48])
- tp(pat[40]) tp(pat[32]) tp(pat[24]) tp(pat[16]) td(pat[8]) td(pat[7]) td(pat[6])
- td(pat[5]) td(pat[4]) td(pat[3]) td(pat[2]) gl() tp(pat[1])
- end
- else
- -- horizontal
- if math.random(2)==1 then
- -- build horizontal 1
- gl() gl() gb() gb() tp(pat[2]) tp(pat[3]) tp(pat[4]) tp(pat[5]) tp(pat[6]) tp(pat[7])
- gr() tp(pat[8]) gr() tp(pat[16]) tp(pat[15]) gl() tp(pat[14]) tp(pat[22]) tp(pat[30])
- tp(pat[38]) tp(pat[46]) gl() tp(pat[54]) gl() tp(pat[55]) tp(pat[47]) tp(pat[39])
- tp(pat[31]) gr() tp(pat[23]) gr() tp(pat[24]) tp(pat[32]) tp(pat[40]) tp(pat[48]) tp(pat[56])
- gr() tp(pat[64]) tp(pat[63]) tp(pat[62]) tp(pat[61]) tp(pat[60]) tp(pat[59]) tp(pat[58])
- gr() tp(pat[57]) gr() tp(pat[49]) tp(pat[50]) gl() tp(pat[51]) gl() tp(pat[43])
- tp(pat[42]) gr() tp(pat[41]) tp(pat[33]) tp(pat[25]) gr() tp(pat[17]) gr() tp(pat[18])
- tp(pat[26]) gl() tp(pat[34]) tp(pat[35]) gr() tp(pat[36]) tp(pat[44]) gl() tp(pat[52])
- gl() tp(pat[53]) tp(pat[45]) tp(pat[37]) tp(pat[29]) tp(pat[21]) gl() tp(pat[13])
- gl() tp(pat[12]) tp(pat[20]) gr() tp(pat[28]) gr() tp(pat[27]) tp(pat[19]) gl() tp(pat[11])
- tp(pat[10]) gr() tp(pat[9]) gl() tp(pat[1])
- else
- -- build horizontal 2
- gf() gl() gb() tp(pat[9]) tp(pat[17]) tp(pat[25]) tp(pat[33]) gl() tp(pat[41]) gl()
- tp(pat[42]) tp(pat[34]) gr() tp(pat[26]) tp(pat[27]) tp(pat[28]) tp(pat[29]) tp(pat[30])
- gr() tp(pat[31]) gr() tp(pat[39]) tp(pat[38]) tp(pat[37]) tp(pat[36]) gl() tp(pat[35]) gl()
- tp(pat[43]) tp(pat[44]) tp(pat[45]) tp(pat[46]) gr() tp(pat[47]) gr() tp(pat[55]) tp(pat[54])
- tp(pat[53]) tp(pat[52]) tp(pat[51]) tp(pat[50]) gl() tp(pat[49]) gl() tp(pat[57]) tp(pat[58])
- tp(pat[59]) tp(pat[60]) tp(pat[61]) tp(pat[62]) tp(pat[63]) gl() tp(pat[64]) tp(pat[56])
- tp(pat[48]) tp(pat[40]) tp(pat[32]) gl() tp(pat[24]) tp(pat[23]) tp(pat[22]) tp(pat[21])
- tp(pat[20]) tp(pat[19]) gr() tp(pat[18]) gr() tp(pat[10]) tp(pat[11]) tp(pat[12]) tp(pat[13])
- tp(pat[14]) tp(pat[15]) gl() tp(pat[16]) gl() tp(pat[8]) tp(pat[7]) tp(pat[6]) tp(pat[5])
- tp(pat[4]) tp(pat[3]) tp(pat[2]) tp(pat[1])
- end
- end
- term.clear() term.setCursorPos(1,1)
- print(dispLine)
- print("| Done! Check out YouTube for more |")
- print("| turtle programs by Kaikaku :) |")
- print(dispLine)
Advertisement
Add Comment
Please, Sign In to add comment