Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- define the function that draws the smiley face
- function drawSmileyFace()
- -- move the turtle to the top-left corner of the face
- turtle.up()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- -- draw the head
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- for i = 1, 4 do
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- end
- turtle.placeDown()
- turtle.forward()
- -- draw the eyes
- turtle.turnLeft()
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- -- draw the mouth
- turtle.turnRight()
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.placeDown()
- turtle.forward()
- turtle.turnLeft()
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- turtle.placeDown()
- turtle.forward()
- turtle.turnRight()
- 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