Skip to content

Fix bugs in square completion and grid validation.

Bug 1: Square Completion Check

The current code incorrectly marks a square as complete (returns true) regardless of whether all surrounding lines have been drawn. The square completion check should only return true if all four lines around a square have been drawn.

Bug 2: Grid Validation

The code currently allows drawing lines over existing ones without throwing an exception. It should throw an IllegalStateException when trying to draw a line that has already been drawn.