|
|
|
|
|
by jfoutz
4196 days ago
|
|
I'm coming around to your way of thinking. If you have a way to draw a wall (twisty line) that doesn't intersect with any other wall, then it's trivial. Just draw a new wall optionally anchored on a wall. The line crossing bookkeeping seems annoying. If i had to do something right now, i'd use a bitmap of cells to indicate the presence or absence of a wall. Can't set a bit with more than 1 adjacent (north/south/east/west) bit set. |
|
Then you couldn't make a T (or + intersection) because as the newly incoming line was about to attach to the existing wall (regardless of any other connectivity), the final "bit" that would attach to the line and existing wall would have 2 adjacent bits set. ex: assuming a wall that travels east/west, and a line coming from the south northwards, when drawing the last pixel of the line before it attaches to the wall, the test would fail. The "south" bit would be set because that bit was set just one step prior, and the "north" bit would be set because that's where the wall is.
Can't set "x" because there is more than one "adjacent" bit set (north and south).