The painting algorithm works like this:
To "paint" starting at row R, column C,
- If that point is already black, quit.
- Move LEFT until hitting a wall or boundary.
- Paint(R-1, C) — the point above.
- Paint(R, C+1) — the point to the right.
- Paint(R+1, C) — the point below.
|