Giter VIP home page Giter VIP logo

mau-mau's Introduction

Mau Mau Project Status: Active - The project has reached a stable, usable state and is being actively developed. Build Status Build status

Command line implementation of a german card game called Mau Mau.

Why?

This project is intended to be a learning tool with comprehensive documentation. It is not only for learning about Python as a programming language it is meant to demonstrate how the language is part of a vast Open Source ecosystem. This simple application uses all my (current) favorite bells and whistles of this ecosystem.

Read the documentation.

Try it

installation from this github repo:

$ pip install "git+https://github.com/obestwalter/mau-mau.git#egg=mau-mau"

Examples for command line use

play a game against the computer:

$ mau-mau play  # Control+C to stop

let the computer simulate a game:

$ mau-mau sim

list the different functions to run statistics:

$ mau-mau-stats

play many games and calculate the average turns needed to finish the game:

$ mau-mau-stats turns

Licenses and Acknowledgements

Licenses

Code is under MIT license and content is CC BY-NC-SA 4.0

code license content license

mau-mau's People

Contributors

lrwilke avatar obestwalter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mau-mau's Issues

mau-mau human crashes immediately on Windows 10

Traceback (most recent call last):
      File "C:\Users\Grigori\mau-mau-venv\Scripts\mau-mau-script.py", line 9, in <module>
        load_entry_point('mau-mau==4.0.0', 'console_scripts', 'mau-mau')()
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\cli.py", line 54, in main
        functionObject(*args)
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\cli.py", line 26, in play_interactive_game
        playedGame = play.play_game(_rulesOfTheGame, ['Eric', 'John', 'human'])
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\play.py", line 12, in play_game
        player.play(game.table)
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\subjects.py", line 91, in play
        self.strategy.play(table)
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\strategy.py", line 25, in play
        self._play(table, card)
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\strategy.py", line 57, in _play
        card = self.choose_best_candidate(candidates)
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\strategy.py", line 94, in choose_best_candidate
        return cls.get_valid_choice(cards, "choose card to play")
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\strategy.py", line 109, in get_valid_choice
        idx = input("%s.\n%s | " % (msg, visu(choices)))
      File "C:\Program Files (x86)\Python 3.5\lib\encodings\cp850.py", line 12, in encode
        return codecs.charmap_encode(input,errors,encoding_map)
    UnicodeEncodeError: 'charmap' codec can't encode character '\u2663' in position 37: character maps to <undefined>

Wanted suit is not logged

When a Jack is up, the strategy or the user is asked for the wanted suit, the answer should be logged to the output.

mau-mau time_durations crashes on Windows 10 (i should switch my OS :-D)

Traceback (most recent call last):
      File "C:\Users\Grigori\mau-mau-venv\Scripts\mau-mau-script.py", line 9, in <module>
        load_entry_point('mau-mau==4.0.0', 'console_scripts', 'mau-mau')()
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\cli.py", line 54, in main
        functionObject(*args)
      File "c:\users\grigori\mau-mau-venv\lib\site-packages\mau_mau\stats.py", line 30, in time_durations
        number=number)
      File "C:\Program Files (x86)\Python 3.5\lib\timeit.py", line 213, in timeit
        return Timer(stmt, setup, timer, globals).timeit(number)
      File "C:\Program Files (x86)\Python 3.5\lib\timeit.py", line 178, in timeit
        timing = self.inner(it, self.timer)
      File "<timeit-src>", line 3, in inner
    ImportError: No module named 'mau_mau.main'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.