Skip to main content

The water jug riddle with Jupyter Notebook

Project description

Water Jug Riddle

The player has two ungraduated jugs with two different capacities. For instance, the first one has a 5 liters capacity and the second one a 7 liters capacity. The player has 3 possible actions on each jug:

  • Fill the jug to its maximum capacity
  • Empty the jug
  • Pour the water of one jug into the other one

The main goal is to obtain all volumes from 0L to 7L. In this version of the game, the player is allowed to try every combination of capacities from 0L to 10L. To execute an action, the player can either :

  • Click on the buttons below the picture
  • Call the class'methods

Link to the demonstration :

Dependencies:

  • notebook
  • ipywidgets
  • ipycanvas
  • traitlets

Install :

pip install ipywidgets_game_jugs

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

ipywidgets_game_jugs-0.2.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

ipywidgets_game_jugs-0.2.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file ipywidgets_game_jugs-0.2.0.tar.gz.

File metadata

  • Download URL: ipywidgets_game_jugs-0.2.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for ipywidgets_game_jugs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ac00abe9a3ab5b22a7ab2cd42aa344aa40b675b64202112d69201e0b856bc5ea
MD5 b8f44a446b018726286001165b09ab7d
BLAKE2b-256 a53261cc95844bf6841bc375cca4b3b6298e3760d751c1eacefaeb2a68175e15

See more details on using hashes here.

File details

Details for the file ipywidgets_game_jugs-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ipywidgets_game_jugs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for ipywidgets_game_jugs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a5cf6793b8f62405881c48516fc995bb3b9661cd0e5691db78addf32f0fbc8f
MD5 4272b90031e0c9109e445ba159a25545
BLAKE2b-256 30f1dbb10416cef69b9fb2f353c5cf61d842e845d49238679ba083d0780642ab

See more details on using hashes here.

Supported by

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