Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- define the function that draws the smiley face
- function drawSmileyFace()
- -- select the blocks for the eyes, mouth, and head
- turtle.select(1)
- local eyesBlock = turtle.getItemDetail()
- turtle.select(2)
- local mouthBlock = turtle.getItemDetail()
- turtle.select(3)
- local headBlock = turtle.getItemDetail()
- -- move the turtle to the top-left corner of the face
- turtle.up()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- -- draw the head
- turtle.select(3)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- for i = 1, 4 do
- turtle.select(3)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.select(3)
- turtle.placeDown()
- turtle.forward()
- -- draw the eyes
- turtle.turnLeft()
- turtle.select(1)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.select(1)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.select(1)
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.select(1)
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.select(1)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- -- draw the mouth
- turtle.turnRight()
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.select(2)
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- end
- -- call the function to draw the smiley face
- drawSmileyFace()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement