# ======================================================================
# 06회차 | 11 미리보기 - 8자와 눈사람 (sim.py)
# ----------------------------------------------------------------------
# 드론 없이 그림으로 미리 본다. (첫 줄이 from sim import start)
# 맨 아래 start() 에 넣는 함수 이름을 바꿔 가며 본다.
#   eight    : 미션 8자
#   snowman  : 09번 눈사람
#   rings    : 07번 크기가 다른 원
#   too_small: 반지름 30 원 -> 오류 메시지 확인
#   rainbow  : 무지개 다리 (위에서 보면 직선, 선 색이 초록 -> 연두로 = 높아짐)
# ======================================================================

from sim import start          # <- 미리보기! 진짜로 날릴 때는 from tello import start

tello_id = "TELLO-58C5B7"


def circle(side, r=60):
    curve(r, r * side, 0, 0, 2 * r * side, 0, 30)
    curve(-r, -r * side, 0, 0, -2 * r * side, 0, 30)


def eight():
    takeoff()
    circle(1)
    circle(-1)
    land()


def snowman():
    takeoff()
    curve(70, 70, 0, 140, 0, 0, 30)
    curve(50, 50, 0, 100, 0, 0, 30)
    curve(-50, -50, 0, -100, 0, 0, 30)
    curve(-70, -70, 0, -140, 0, 0, 30)
    land()


def rings():
    takeoff()
    circle(1, 50)
    circle(1, 80)
    land()


def too_small():
    takeoff()
    circle(1, 30)
    land()


def rainbow():
    takeoff()
    curve(60, 0, 45, 120, 0, 0, 30)
    cw(180)
    curve(60, 0, 45, 120, 0, 0, 30)
    cw(180)
    land()


start(tello_id, eight)         # <- snowman, rings, too_small, rainbow 로 바꿔 보기
