Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandoncardoso/mnk
An MNK game library.
https://github.com/brandoncardoso/mnk
game mnk numpy python tictactoe
Last synced: 12 days ago
JSON representation
An MNK game library.
- Host: GitHub
- URL: https://github.com/brandoncardoso/mnk
- Owner: brandoncardoso
- Created: 2018-02-20T00:22:52.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-11-11T06:14:16.000Z (about 4 years ago)
- Last Synced: 2024-11-08T10:09:06.327Z (about 2 months ago)
- Topics: game, mnk, numpy, python, tictactoe
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MNK Game
A connect K-in-a-row game on a M*N grid.### Setup
With pip.
```
$ pip install git+https://github.com:BrandonCardoso/mnk_game.git
```Without pip.
```
$ git clone https://github.com/BrandonCardoso/mnk_game.git
$ cd mnk_game
$ python setup.py install
```### How to use
Here's an example of setting up a Tic-Tac-Toe game between 2 random players.
```
from mnk_game import MNK_Game, RandomPlayerp1 = RandomPlayer()
p2 = RandomPlayer()
game = MNK_Game(grid_width=3, grid_height=3, win_chain_length=3, p1, p2)
game.play(draw_grid=True)
```