This is a strategic logic game for two players. The rules are deceptive: you take turns removing 1-3 stones from a pile of 13. The player stuck with the last stone loses. It sounds like luck, but there is a mathematical strategy to win every time.
- Visual Feedback: The pile of stones updates dynamically on the screen as players take turns.
- Customizable Rules: I added a Settings menu where you can flip the win condition (e.g., "Winner is the last player to pick"), which completely changes the strategy.
- Persistence: You can close the app in the middle of a game, and when you reopen it, the board state (whose turn it is, how many stones are left) is restored exactly as you left it.
- Statistics: Tracks wins per player and total games played.
- State Management: I used JSON serialization (Gson) to save the complex game object to
SharedPreferences. - Logic Separation: The game rules are isolated in a dedicated Model class, keeping the Activity code clean.
- Tech: Java, Android Jetpack, Gson.