Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/primaryobjects/isolation
Isolation, AI game implemented in Javascript and React, using MiniMax with Alpha Beta Pruning.
https://github.com/primaryobjects/isolation
ai alpha-beta-pruning artificial artificial-intelligence game game-development intelligence isolation javascript js minimax minimax-algorithm minimax-search minimax-tree react
Last synced: about 1 month ago
JSON representation
Isolation, AI game implemented in Javascript and React, using MiniMax with Alpha Beta Pruning.
- Host: GitHub
- URL: https://github.com/primaryobjects/isolation
- Owner: primaryobjects
- Created: 2019-12-12T19:07:03.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T20:55:47.000Z (almost 5 years ago)
- Last Synced: 2024-10-29T22:50:07.940Z (3 months ago)
- Topics: ai, alpha-beta-pruning, artificial, artificial-intelligence, game, game-development, intelligence, isolation, javascript, js, minimax, minimax-algorithm, minimax-search, minimax-tree, react
- Language: JavaScript
- Homepage:
- Size: 150 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Isolation
=========An AI browser-based game, where the goal is to be the last player with an available move.
[Play Online](http://primaryobjects.github.io/isolation/)
[Intelligent Heuristics for the Game Isolation using AI and Minimax](http://www.primaryobjects.com/2020/01/26/intelligent-heuristics-for-the-game-isolation-using-ai-and-minimax/)
## What is it?
Isolation offers a simple environment to demonstrate the artificial intelligence AI algorithm [Minimax](https://en.wikipedia.org/wiki/Minimax) with [Alpha-beta pruning](https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning).
![Isolation - game using AI player with minimax and intelligent heuristics](images/isolation-anim.gif)
## How to Play
At each turn, the player may choose to move any number of spaces up, right, down, left, or diagonally as long as the path is not blocked by a previously visited cell.
After the first player selects a cell to start, the second player may choose a starting cell. Players then take turns moving their player to a new cell, according to the rules above, until a player can no longer make a move - meaning that the player is effectively trapped. At this point, the opposing player wins.
One of the simplest implementations of the game is a 3x3 grid.
## AI Opponent Using Minimax
The AI computer player uses the Minimax algorithm. This allows the AI to take the current game board state and build a tree of all possible moves and next states that each player may take. The Minimax algorithm is then applied from the bottom of the tree, upwards, in order to determine the best move to make for the current turn. The AI always assumes that the player will make an optimal move, and bases its decision accordingly.
Isolation implements a port of the Minimax with Alpha-beta pruning algorithm developed for [Python](https://tonypoer.io/2016/10/28/implementing-minimax-and-alpha-beta-pruning-using-python/).
## Running the Game
[Play Online](https://codepen.io/primaryobjects/full/QWWGgmR)
Or run locally, with the following command.
```bash
cd isolation
python -m SimpleHTTPServer 8000
```Any http server may be used to host the game locally. An example of using the Python SimpleHTTPServer is shown above. Execute the above command from the directory containing the game. Then navigate to http://localhost:8000 to play the game.
## How is it Made?
Isolation is developed with Javascript, React, Twitter Bootstrap.
[Edit](https://codepen.io/primaryobjects/full/QWWGgmR) the code on CodePen.
## License
MIT
## Author
Kory Becker
http://www.primaryobjects.com/kory-becker