Skip to content

Conversation

@Chiraggupta0
Copy link

Fixes #128

Summary

Fixes a bug where Board.isFull() never returned true because movesCount was never incremented.

Changes

  • movesCount changed from final to mutable (int).
  • Added movesCount++ inside placeSymbol() after a valid placement.
  • Ensured movesCount is initialized to 0 in constructor.
  • Added argument validation and user-friendly board print.

How to test

  1. Build & run tests locally:
    • Maven: mvn clean test
    • Gradle: ./gradlew test (or gradlew.bat test on Windows)
  2. Manual test:
    • Create a 3x3 board and call placeSymbol() 9 times with valid coordinates.
    • isFull() should return true after 9 moves.

Related Issue

Closes #<128> with actual issue if applicable -->

Notes

This is a small behavioural fix; no API changes expected.

🙏 Credits

Thanks to @subhajit100 for reporting the issue.
Requesting review from @ashishps1

@Chiraggupta0 Chiraggupta0 deleted the issue-128 branch November 19, 2025 16:55
@Chiraggupta0 Chiraggupta0 restored the issue-128 branch November 19, 2025 17:01
@Chiraggupta0 Chiraggupta0 reopened this Nov 19, 2025
@Chiraggupta0
Copy link
Author

hey @ashishps1 requesting review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

movesCount seems not be incremented

1 participant