Sally is a very bad skater, she can only skate in one direction! But Sally still wants to find her dad in the least amount of moves possible so that she can get off the ice. Sally's only way of stopping are walls.
(#) -- Wall
(.) -- Free space
(S) -- Sally's starting position
(D) -- Dad's position
Find the sum of the shortest paths of these five 20x20 ice rinks. Ice rinks are separated by hyphens. Text file with ice rinks
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
First I loaded the rink files into an array of strings: rinks[n][y] = y-th line of rink #n, with n = 0 .. 4 and y = 0 .. 19.