Fix coding errors in Dots and Boxes Java game
The current implementation of the Dots and Boxes game has several bugs and coding issues that need to be fixed.
1.The code for checking if a square is complete is wrong. It just returns true at the moment, whereas it should test if the lines surrounding the square have been "drawn". 2.The grid doesn't complain if you "draw" a line that has already been drawn. It should throw an IllegalStateException 3. Apply appropriate fixes 4. Test the updated functionality to ensure the game behaves as expected