King of Diamonds is a guessing game where players, including AI, compete to guess a number closest to a calculated "twist" number. The game continues until only one player remains.
https://aliceinborderland.fandom.com/wiki/King_of_Diamonds
- Players: The game consists of one human player and a specified number of AI players.
- Rounds: Each round, players guess a number between 0 and 100.
- Twist Number: The twist number is calculated as 80% of the average of all guesses.
- Elimination: Players with points less than or equal to -10 are eliminated.
- Winning a Round: The player with the guess closest to the twist number wins the round.
- End of Game: The game continues until only one player remains, who is declared the grand winner.
- Clone the repository.
- Install the required dependencies:
pip install -r requirements.txt
- Run the game:
python main.py
- Follow the on-screen instructions to input your guesses.
- init.py: Initializes the package.
- games.py: Contains the
Game
class which implements the game logic. - main.py: Entry point to start the game.
- player.py: Contains the
Player
class which represents a player in the game. - settings.json: Configuration file containing player names.
You can customize the player names in the settings.json file:
{
"human_name": "player 1",
"ai_names": ["player 2", "player 3", "player 4", "player 5"]
}