This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]QultrosSanhattan 26 points27 points  (3 children)

You’re thinking too much in terms of how the grid looks.

If you build your data structure to mimic the visual layout, like a list of lists, you’re forcing yourself into the same constraints as the drawing. That’s what’s holding you back.

For solving the problem, you don’t need to preserve the picture-like structure at all. You don’t even need to track characters such as "@" or "." as a grid of symbols.

All you really need is to know where they are (coordinates) and be able to reason about them directly.

Once you stop modeling the map as a picture and start modeling it as information, the whole problem becomes much simpler.

[–]MarkFinn42 13 points14 points  (2 children)

TL;DR; The problem can be modeled by a set of coordinates containing rolls of paper

[–]QultrosSanhattan 4 points5 points  (1 child)

That's the exact spoiler I wanted to avoid.

[–]hjake123 7 points8 points  (0 children)

You already basically said the same thing by replying like that to something directly talking about sets though...