Skip to content

About

Java implementation of Mancala with Kalah and Ayo rule variants, Swing GUI, and save/load profiles.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Mancala

Java implementation of Mancala with Kalah and Ayo rule variants, a Swing GUI, and save/load profiles.

Features

  • Two rule sets: Kalah and Ayo
  • Swing-based graphical interface
  • Save and resume games via player profiles
  • Custom exceptions for invalid moves and game-state errors
  • Modular OOP design (Board, Pit, Store, Player, Game, Rules)

Description

The code represents a basic implementation of the Mancala game in Java. It consists of five classes which each have their own duties: Board, MancalaGame, Pit, Player, and Store. For example, the Board class creates the Mancala board with pits and stores, allowing players to make moves, distribute stones, and check the game's status. Moving on, the MancalaGame class manages the game, players, and their interactions with the board. Next, the Pit class represents individual pits on the board, keeping track of stone counts. Furthermore, the Player class defines player attributes, including their name and associated store. Lastly, the Store class is responsible for storing stones and keeping track of the player owner. Overall, the code works together to make a functional Mancala game, including moves, captures, and win conditions, and error handling is also implemented.

Getting Started

Requirements

  • JDK 17 (other versions may not be compatible)
  • Gradle

Build and Run

gradle build
java -cp build/classes/java/main ui.MancalaUI

Project Structure

src/main/java/
├── mancala/   # Game logic, rules, and data structures
└── ui/        # Swing user interface
assets/        # Images and resources
config/        # Build configuration

Author

Sukhman Dhaliwal

About

Java implementation of Mancala with Kalah and Ayo rule variants, Swing GUI, and save/load profiles.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages