Advertisement
TechManDylan

ChatGPT Smiley V0.1

Jan 6th, 2023
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.20 KB | None | 0 0
  1. -- define the function that draws the smiley face
  2. function drawSmileyFace()
  3.   -- move the turtle to the top-left corner of the face
  4.   turtle.up()
  5.   turtle.turnLeft()
  6.   turtle.forward()
  7.   turtle.turnRight()
  8.  
  9.   -- draw the head
  10.   turtle.placeDown()
  11.   turtle.forward()
  12.   turtle.turnRight()
  13.   for i = 1, 4 do
  14.     turtle.placeDown()
  15.     turtle.forward()
  16.     turtle.turnRight()
  17.   end
  18.   turtle.placeDown()
  19.   turtle.forward()
  20.  
  21.   -- draw the eyes
  22.   turtle.turnLeft()
  23.   turtle.placeDown()
  24.   turtle.forward()
  25.   turtle.turnRight()
  26.   turtle.placeDown()
  27.   turtle.forward()
  28.   turtle.turnRight()
  29.   turtle.placeDown()
  30.   turtle.forward()
  31.   turtle.turnLeft()
  32.   turtle.placeDown()
  33.   turtle.forward()
  34.   turtle.turnLeft()
  35.   turtle.placeDown()
  36.   turtle.forward()
  37.   turtle.turnRight()
  38.  
  39.   -- draw the mouth
  40.   turtle.turnRight()
  41.   turtle.placeDown()
  42.   turtle.forward()
  43.   turtle.turnLeft()
  44.   turtle.placeDown()
  45.   turtle.forward()
  46.   turtle.turnLeft()
  47.   turtle.placeDown()
  48.   turtle.forward()
  49.   turtle.turnRight()
  50.   turtle.placeDown()
  51.   turtle.forward()
  52.   turtle.turnRight()
  53.   turtle.placeDown()
  54.   turtle.forward()
  55.   turtle.turnLeft()
  56. end
  57.  
  58. -- call the function to draw the smiley face
  59. drawSmileyFace()
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement