if (knitr:::is_latex_output()) {
knitr::asis_output('\\url{....}')
} else {
knitr::include_graphics("fig/Harvest_01.gif")
}
move(), turn_left(), take()object_here()while 혹은 if 과 결함harvest_one_row() 함수를 작성하고 6번 반복if (knitr:::is_latex_output()) {
knitr::asis_output('\\url{....}')
} else {
knitr::include_graphics("fig/Harvest_01.gif")
}
# 추수 위치로 이동 ----
def turn_right():
turn_left()
turn_left()
turn_left()
def ready_harvest():
move()
turn_left()
move()
move()
turn_right()
ready_harvest()
# 한줄 추수 ----
def harvest_one_row():
if not object_here():
move()
while object_here():
if object_here():
take()
move()
# harvest_one_row()
# 다음 추수 위치로 이동
def turn_around():
turn_left()
turn_left()
def move_to_next_row():
turn_around()
repeat 7:
move()
turn_right()
move()
turn_right()
# move_to_next_row()
# 전체 6줄 추수
repeat 6:
harvest_one_row()
move_to_next_row()move(), turn_left(), take()object_here()while 혹은 if 과 결함harvest_one_row() 함수를 작성하고 6번 반복if (knitr:::is_latex_output()) {
knitr::asis_output('\\url{....}')
} else {
knitr::include_graphics("fig/Harvest_02.gif")
}
# 추수 위치로 이동 ----
def turn_right():
turn_left()
turn_left()
turn_left()
def ready_harvest():
move()
turn_left()
move()
move()
turn_right()
ready_harvest()
# 한줄 추수 ----
def harvest_one_row():
repeat 6:
if not object_here():
move()
while object_here():
take()
# 다음 추수 위치로 이동
def turn_around():
turn_left()
turn_left()
def move_to_next_row():
turn_around()
repeat 6:
move()
turn_right()
move()
turn_right()
# 전체 6줄 추수
repeat 6:
harvest_one_row()
move_to_next_row()move(), turn_left(), take()object_here()while 혹은 if 과 결함harvest_one_row() 함수를 작성하고 6번 반복if (knitr:::is_latex_output()) {
knitr::asis_output('\\url{....}')
} else {
knitr::include_graphics("fig/Harvest_03.gif")
}
# 추수 위치로 이동 ----
def turn_right():
turn_left()
turn_left()
turn_left()
def ready_harvest():
move()
move()
turn_left()
move()
move()
turn_right()
ready_harvest()
# 당근 심기 ----
def fix_one_row():
repeat 6:
while not object_here():
put()
# 당근 1개 이상인 경우 다 뽑아내고 1개 심는다.
if object_here():
while object_here():
take()
put()
move()
# 다음 추수 위치로 이동
def turn_around():
turn_left()
turn_left()
def move_to_next_row():
turn_around()
repeat 6:
move()
turn_right()
move()
turn_right()
# 전체 6줄 추수
repeat 6:
fix_one_row()
move_to_next_row()