1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 4-3 °ÅºÏÀÌ Á¦¾îÇϱâ, 101ÂÊ # import turtle t = turtle.Turtle() # Ä¿¼ÀÇ ¸ð¾çÀ» °ÅºÏÀÌ·Î ÇÑ´Ù. t.shape("turtle") # °ÅºÏÀÌ°¡ ±×¸®´Â ¼±ÀÇ µÎ²²¸¦ 3À¸·Î ÇÑ´Ù. t.width(3) # °ÅºÏÀ̸¦ 3¹è È®´ëÇÑ´Ù. t.shapesize(3, 3) # ¹«ÇÑ ·çÇÁ·Î ÁøÀÔÇÑ´Ù. ÀÌ ·çÇÁ´Â Ctrl+C¸¦ ÀÔ·Â¹Þ¾Æ Á¾·áµÈ´Ù. while True: command = input("¸í·ÉÀ» ÀÔ·ÂÇϽÿÀ: ") if command == "l": # »ç¿ëÀÚ°¡ "l"À» ÀÔ·ÂÇÏ¿´À¸¸é t.left(90) # ¿ÞÂÊÀ¸·Î 90µµ ȸÀü t.forward(100) if command == "r": # »ç¿ëÀÚ°¡ "r"À» ÀÔ·ÂÇÏ¿´À¸¸é t.right(90) # ¿À¸¥ÂÊÀ¸·Î 90µµ ȸÀü t.forward(100) | cs |