https://github.com/pd-mera/game-of-nim
Master the Minimax Algorithm and Alpha-Beta Pruning with Game of Nim
https://github.com/pd-mera/game-of-nim
alpha-beta-pruning game game-ai minimax-algorithm
Last synced: 3 months ago
JSON representation
Master the Minimax Algorithm and Alpha-Beta Pruning with Game of Nim
- Host: GitHub
- URL: https://github.com/pd-mera/game-of-nim
- Owner: PD-Mera
- Created: 2024-05-08T01:33:33.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-09T04:17:26.000Z (about 1 year ago)
- Last Synced: 2025-01-08T19:46:55.941Z (5 months ago)
- Topics: alpha-beta-pruning, game, game-ai, minimax-algorithm
- Language: Python
- Homepage:
- Size: 113 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Master Minimax Algorithm with Game of Nim

## How to run
Just specify game you want to play and run
``` bash
python console.py -g simple
# python console.py -g regular --first Human
# python console.py -g misere --second Human
# python console.py -g split --first Human --second Human
```## Some example games
- Simple Nim

- Regular Nim

## New knowledges learned from this projects
- How to use recursive to implement minimax algorithm
- Principle about minimax algorithm
- ~~Using `@cache` to cache minimax state~~ (Support in python > 3.9)
> Instead using `@lru_cache(maxsize=None)`
- How to use Alpha-Beta Pruning## TODO
- [ ] Implement more variants
## Reference
- [Minimax in Python: Learn How to Lose the Game of Nim](https://realpython.com/python-minimax-nim/)