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.2.1.tar.gz
(18.2 kB
view hashes)
Built Distribution
Close
Hashes for marienbad-0.1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1be72b82fec65699147517e80122a7b096a8d85d1fcc4b4a05109631fae7479f |
|
MD5 | 4c1680edb81ae83750f6ef171a492841 |
|
BLAKE2b-256 | 40553b79791215e6066452b2483d03b7a64f52600f6a19230faad657fd2bfe89 |