A python engine to create and test Go Fish bots
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
To get a local copy up and running follow these simple example steps.
- Install the package
pip install git+https://github.com/Klinefelters/GoFishEngine
- Set up the engine:
from gofish import Engine
from gofish.examplePlayers import RandPlayer
from logging import INFO # Echange this with debug to get more info
engine = Engine(
players=[
RandPlayer("Random 0"),
RandPlayer("Random 1"),
# Add up to 7 players
],
logLevel=INFO)
- Render the results:
- Print the game out to the terminal
engine.playGame()
- Serve the game as a webgui at localhost:8000
engine.serveGame()
- Evaulate players over any number of runs
print(engine.evaluatePlayers(runs=1000))
- Yeild the game as a generator of summaries
while True: try: summary = next(engine.yieldGame()) print(summary.getDict()) input() except StopIteration: break
example:
from gofish import Engine
from gofish.examplePlayers import RandPlayer
from logging import INFO # Echange this with debug to get more info
engine = Engine(
players=[
RandPlayer("Random 0"),
RandPlayer("Random 1"),
# Add up to 7 players
],
logLevel=INFO)
engine.serveGame()
- Clone the repo:
git clone https://github.com/klinefelters/GoFishEngine
- Install the client:
cd client npm i
- Now when testing run the following for hotreloads:
npm run dev
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Klinefelters - klinefelters@etown.edu
Project Link: https://github.com/klinefelters/GoFishEngine