Professional Documents
Culture Documents
Level 2
Level 2
N
boardMatrix
pacmanRow pacmanColumn coinCount
sequenceLength
movement (repeated sequenceLength times)
10 4
WWWWWWWWWW
WCCCCPCCCW
WCWWCWWWCW
WCWWCWWWCW
WCWWCWWWCW
WCWWCCCCCW
WCWWCWWWCW
WCWWCWWWCW
WCCCCCCCCW
WWWWWWWWWW The path that Pacman walks is highlighted. The
2 6 last ‘U’ command makes Pacman cross a coin for
5 a second time. Since the coin was already
LDDDU collected, it does not count a second time