Академический Документы
Профессиональный Документы
Культура Документы
Break down that sub-task into smaller “...and each side is really 3 zig-zag drawStep()
sub-task(s)... steps…”
Keep going until you’re down to the “...each step is just Stop; this is simple enough to
commands you already have access to. forward-left-forward-right…” begin programming.
Functions:
right - turn left 3 times
drawCross - move forward 2 times, turn left, move forward, turn left twice,
move forward twice, call function right twice, move forward, call function
right, move forward, call function , move forward 3 times, turn left twice
drawFigure - call function cross, call function right, call function cross, call
function right, call function cross, call function ight, call function cross, call
function right
The other group named their functions similar to the way we named ours, but they used drawHitMarker instead of
drawFigure and turnAround instead of right or left