Install Process
A quick tutorial to make HackaGames run on your computer.
Nota bene:
- HackaGames is natively developed on Linux systems. Documentation is built regarding Ubuntu-like distributions. Commands are given in bash syntax. But most of the commands work pretty well on Windows PowerShell
- IDE (Integrated Development Environment), it is encouraged to use VisualStudio Code code.visualstudio.com and to create a project dedicated to HackaGames tutorials. Command should be working on a terminal opened in the IDE.
- Jupiter NoteBook HackaGames tutorials works on web-based python IDE like Google Colab. In that case shell command (like
pip) should start with an exclamation mark (!).
Getting Started (Python)
A version restricted to Python resources can be easily installed thanks to the pip package manager:
pip install hackagames # or: !pip install hackagames
From that point, for a first contact, you can play with the simplest proposed game: Py421, from a shortcut:
hacka-py421-play # or: !hacka-py421-play
Alternatively - it is possible to edit and execute a short script launching a game:
from hackagames.py421 import GameMaster
from hacka.player import PlayerShell
gameMaster= GameMaster("Solo")
gameMaster.launchLocal( [PlayerShell()], 1 )
The Py421 is a three-dice game. The player can roll several times to get the best combination. The actions consist of keeping or rolling each of the 3 dice. So there are 8 possible actions:
keep-keep-keep,keep-keep-roll,keep-roll-keep,keep-roll-roll,roll-keep-keep,roll-keep-roll,roll-roll-keepandroll-roll-roll
The goal is to optimize the combination of dice before the end of the second turn. The best combination ever is 4-2-1. But you can explore other combinations.
- You can then follow the tutorial of First Bot to learn how to implement an autonomous player for Py421 the game.
Installation from sources (optional)
HackaGames is shared on github under an open-source license. It is possible to install it from sources.
Simply clone the Git repository, then use Python pip on the local project directory.
git clone https://github.com/ktorz-net/hackagames
pip install ./hackagames
or
python -m pip install ./hackagames
That's it; you have the last in-development version.
Dependencies
The project relies on several libs:
- hackapy itself is based on zmq for the network protocol of HackaGames
- tqdm offers nice but simple process-bars