Skip to main content

42-Points-Game

42Points Maintainability codecov PyPI PyPI - Python Version PyPI - License

Python implementation of the fourty-two points game.

Introduction

"42 Points" game is a variation based on the popular and long-lived "24 Points" game. The player should only use addition, subtraction, multiplication, division and parentheses and five integers between 0 and 13 (inclusive) to get 42. It's really simple to understand, as the core of the game still relies on math calculations.

Design Logic

This package is designed to work as a core processing part, providing:

  • Problem database
  • Problem generation (by user / in database)
  • Start / stop the game
  • Timer for solutions
  • Player statistics
  • Equivalent solution detection
  • A bunch of APIs and exceptions

This package is not designed to fully implement everything with the game, so the formatting parts should be written by end-users. But don't worry, the API in this package is enough to create whatever you need.

Usage

As equivalent detection is not a easy issue, we will make several changes to make sure it satisfies our need in the following upgrades. Please just kindly use the latest version.

It's recommended to use pip:

    pip install --upgrade 42Points

But building with setup.py will also work, as no other third-party dependencies are required for this package.

After you have installed the package, you are almost done. If you want to try it out quickly, just open your IDLE (or something like that) and type:

    from ftptsgame import FTPtsGame
    app = FTPtsGame() # initialize
    app.generate_problem('database') # generate a problem beforehand
    app.start() # start the game
    app.get_current_problem() # show the problem
    app.solve('your solutions') # put forward a solution
    app.get_current_solutions() # show all solutions
    app.stop() # stop the game

Well, you can integrate this package into your projects by using just the same way, and you can format problems in all the ways you like.

License

This package is licensed under the MIT License.

Contribution

Pull requests and issues are warmly welcomed.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

42Points-1.0.8.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

42Points-1.0.8-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file 42Points-1.0.8.tar.gz.

File metadata

  • Download URL: 42Points-1.0.8.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.2

File hashes

Hashes for 42Points-1.0.8.tar.gz
Algorithm Hash digest
SHA256 8028f5ffb33dbb54288d9f2dc9fe2d1c6588a5bad7326a95c7e145edaf647382
MD5 8c9d04ec4959a2767f76d77bb894b11b
BLAKE2b-256 2567047717f97e6eb39810b06e13615c4e1e1d4e9f55a8d2aacffebc0d60e28b

See more details on using hashes here.

File details

Details for the file 42Points-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: 42Points-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.2

File hashes

Hashes for 42Points-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c7398c6b5d23c3e63b721d7c9ccaf50ef9899cadc2b1b0d52c6bb338d2dbbd42
MD5 13999abcfdc9acf47e4c9c7dec905e23
BLAKE2b-256 3884943dad4ab684302214a5089b650fe2c4aae4e10f619f5d01517d710349d8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page