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.tar.gz
(18.2 kB
view hashes)
Built Distribution
marienbad-0.1.2-py3-none-any.whl
(19.9 kB
view hashes)
Close
Hashes for marienbad-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460d2c4b8634ef24d4002e71981a75d0ee4b6077c6678ed11f00eaaed9f2e1df |
|
MD5 | 252586243f12cd02ef8f56b8e25d3ef6 |
|
BLAKE2b-256 | c6ba59016252844099ff110eb83dc6b6de32cb87f9d4bf95e5adcd5bfd5014b8 |