A toolsuite for win at Marienbad (Nim) game.
Project description
Marienbad
A simple toolsuite for help you to win at Marienbad game, a Nim game.
It is recommended to use the PyPy interpreter instead of the CPython standart.
Generator
Pour utiliser cet outil, entrez la commande :
marienbad-generator
Pour voir toutes les options disponibles :
marienbad-generator --help
Vous pouvez aussi le démarrer depuis un script python :
import marienbad
marienbad.generator.main()
Bien sûr, vous pourvez ré-utiliser certaines fonctions :
from marienbad.generator import checkCombination
checkCombination([1,3,5,7]) # True
checkCombination([1,3,6,7]) # False
La fonction generateTable
imprime le résultat sur la sortie standart. Pour récupérer cette sortie, utilisez le script suivant :
import sys
from io import StringIO
# rediriger stdout dans un buffer :
sys.stdout = StringIO()
# appel de la fonction qui remplira stdout (donc le buffer)
generateTable(10,10)
# récupérer le contenu du buffer :
s = sys.stdout.getvalue()
# fermer le buffer :
sys.stdout.close()
# rediriger stdout vers la sortie standart :
sys.stdout = sys.__stdout__
# le résultat est maintenant dans la variable s
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
marienbad-0.1.1.tar.gz
(17.1 kB
view hashes)
Built Distribution
marienbad-0.1.1-py3-none-any.whl
(18.0 kB
view hashes)
Close
Hashes for marienbad-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8309b733aa8a6c63cae167ce451f3df966651b313da9f5062ae545984929255 |
|
MD5 | f897d4aa4c29b54d8157fcc03a9fa242 |
|
BLAKE2b-256 | 0199fd94162e07ba1af51eb3eb8e55f53855c35ef073d58a71b6e7e00a7c71de |