U E D R , A S I H C RSS

RUR-PLE/Maze


1. RUR-PLE/Maze


1.1. 리팩토링 전

  • 이것도 노가다. 아직 리팩토링 전단계


~cpp 
turn_left()
move()
move()

turn_left()
turn_left()
turn_left()

move()

turn_left()
turn_left()
turn_left()

move()
move()

turn_left()

move()
move()

turn_left()

move()
move()
move()

turn_left()

move()
move()

turn_left()
turn_left()
turn_left()

move()

turn_left()
turn_left()
turn_left()

move()
move()
move()


turn_left()
turn_left()
turn_left()

move()

turn_left()

move()

pick_beeper()
turn_off()


1.2. 리팩토링 후

~cpp 
def turn_right() :
    turn_left()
    turn_left()
    turn_left()
def go_ThreeStep() :
    move()
    move()
    move()

turn_left()
move()
move()
turn_right()
move()
turn_right()
move()
move()
turn_left()
move()
move()
turn_left()
go_ThreeStep()
turn_left()
move()
move()
turn_right()
move()
turn_right()
go_ThreeStep()
turn_right()
move()
turn_left()
move()
pick_beeper()
turn_off()
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:27:49
Processing time 0.0145 sec