Advertisement
TechManDylan

ChatGPT Smiley V0.2

Jan 6th, 2023
1,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. -- define the function that draws the smiley face
  2. function drawSmileyFace()
  3.   -- select the blocks for the eyes, mouth, and head
  4.   turtle.select(1)
  5.   local eyesBlock = turtle.getItemDetail()
  6.   turtle.select(2)
  7.   local mouthBlock = turtle.getItemDetail()
  8.   turtle.select(3)
  9.   local headBlock = turtle.getItemDetail()
  10.  
  11.   -- move the turtle to the top-left corner of the face
  12.   turtle.up()
  13.   turtle.turnLeft()
  14.   turtle.forward()
  15.   turtle.turnRight()
  16.  
  17.   -- draw the head
  18.   turtle.select(3)
  19.   turtle.placeDown()
  20.   turtle.forward()
  21.   turtle.turnRight()
  22.   for i = 1, 4 do
  23.     turtle.select(3)
  24.     turtle.placeDown()
  25.     turtle.forward()
  26.     turtle.turnRight()
  27.   end
  28.   turtle.select(3)
  29.   turtle.placeDown()
  30.   turtle.forward()
  31.  
  32.   -- draw the eyes
  33.   turtle.turnLeft()
  34.   turtle.select(1)
  35.   turtle.placeDown()
  36.   turtle.forward()
  37.   turtle.turnRight()
  38.   turtle.select(1)
  39.   turtle.placeDown()
  40.   turtle.forward()
  41.   turtle.turnRight()
  42.   turtle.select(1)
  43.   turtle.placeDown()
  44.   turtle.forward()
  45.   turtle.turnLeft()
  46.   turtle.select(1)
  47.   turtle.placeDown()
  48.   turtle.forward()
  49.   turtle.turnLeft()
  50.   turtle.select(1)
  51.   turtle.placeDown()
  52.   turtle.forward()
  53.   turtle.turnRight()
  54.  
  55.   -- draw the mouth
  56.   turtle.turnRight()
  57.   turtle.select(2)
  58.   turtle.placeDown()
  59.   turtle.forward()
  60.   turtle.turnLeft()
  61.   turtle.select(2)
  62.   turtle.placeDown()
  63.   turtle.forward()
  64.   turtle.turnLeft()
  65.   turtle.select(2)
  66.   turtle.placeDown()
  67.   turtle.forward()
  68.   turtle.turnRight()
  69.   turtle.select(2)
  70.   turtle.placeDown()
  71.   turtle.forward()
  72.   turtle.turnRight()
  73.   turtle.select(2)
  74.   turtle.placeDown()
  75.   turtle.forward()
  76.   turtle.turnLeft()
  77. end
  78.  
  79. -- call the function to draw the smiley face
  80. drawSmileyFace()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement