Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/telos-matter/max-nj
Generic implementation of the Max-n algorithm in Java
https://github.com/telos-matter/max-nj
abstraction algorithm generic implementation java max max-n max-n-algorithm min-max min-max-algorithm multiple-players n n-player template
Last synced: 29 days ago
JSON representation
Generic implementation of the Max-n algorithm in Java
- Host: GitHub
- URL: https://github.com/telos-matter/max-nj
- Owner: telos-matter
- License: mit
- Created: 2024-07-15T22:21:57.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-08-11T17:31:58.000Z (5 months ago)
- Last Synced: 2024-08-11T18:58:16.203Z (5 months ago)
- Topics: abstraction, algorithm, generic, implementation, java, max, max-n, max-n-algorithm, min-max, min-max-algorithm, multiple-players, n, n-player, template
- Language: Java
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Max-nJ ![DEVELOPMENT STATUS: version 0.1](https://badgen.net/badge/DEVELOPMENT%20STATUS/version%200.1/green)
**Max-n** in **J**ava
An abstract implementation of the Max-n algorithm that takes away the hard work, and lets focus on the evaluation function.## What is the Max-n algorithm?
Max-n algorithm is an algorithm that can be used to find the best move in a game with n players. It does so by recursively evaluating the possible moves that each player can make, and then selecting the move that maximizes the score of the player that is currently playing. Which is effectively the same as predicting the moves that the other players will make, assuming that they are playing rationally, and are aiming only to maximize their own score.
If you are already familiar with the [Minimax](https://en.wikipedia.org/wiki/Minimax) algorithm, then you can think of Max-n as a generalization of Minimax that can be used with n players instead of just two. Minimax happens to just be a special case of Max-n with n=2, and where the first players' score is the negative of the second players' score.## Important notice:
An important feature that is yet to be added is pruning.## Example:
Check out the TicTacToe *test* for an example of how to use it.## How-to:
After cloning the repository, install the project locally like so:
```bash
mvn clean install
```And then you can use it in your other projects by adding it as a dependency in your `pom.xml` file:
```xmltelos-matter
max-nj
0.1```