Skip to main content

CheesePy Game

Introduction

CheesePy is a maze-based game crafted to facilitate the understanding of fundamental principles in computer programming.

Players navigate a mouse through various challenges, each level increasing in difficulty from basic to more advanced. They provide Python code to direct the mouse's actions.

Through conquering these levels, you will grasp essential programming concepts like conditions (if-else), loops (while/for), functions, and language syntax.

Once installed, the game will run completely offline.

Install

  1. Install Python 3 on your system, if you haven't already.

  2. From a terminal window, install cheesepy game with the following command:

pip install cheesepy_game
  1. Check that the install went well by running this commmand:
python -m cheesepy_game

If you do not get any error message, it means everything went fine and the game is installed in your system. You can safely delete the downlaoded and extracted files and folders.

WARNING: in some cases you might need to use pip3 and python3 in the previous commands instead of pip and python.

Quickstart

To start the game, open your code editor (for example using IDLE). Then create a new python file, paste the following code into it and run it.

from cheesepy_game import start_game, Buddy
# set the Mouse name
Buddy.set_name("Sarah")

start_game()

level1

A window will pop-up showing the first puzzle. If you have a look at the printed output you will see something like this:

    Game started! You are playing level 1. Good luck, Sarah!
    Get the cheese.

As the game says, You have to Get the cheese. Move around using the keyboard arrow keys, but keep an eye on what is printed in the terminal window, you will see messages like these:

Game started! You are playing level 1. Good luck, Sarah!
Get the cheese.
>>> New position: (x:2, y:1)
>>> New position: (x:3, y:1)
>>> New position: (x:4, y:1)

Once you are on the cheese press 'G' (grab) and read the messages:

>>> Got cheese!
OK, This is what you need to do to pass this level. Now try with code only!

That is it, this is exactly what you need to do to complete this level. But if you want to get to the next level you need to solve this one with code. Let's see.

In order to get the cheese, the mouse has to move 3 times to the right to get on the cheese, then grab it. You can achieve this behavior with the code here belo. Delete the prevous code and copy-paste the following:

from cheesepy_game import start_game, Buddy

# set the Mouse name
Buddy.set_name("Sarah")

def solution():
    # this is your solution to the puzzle in the current level
    # These are your instructions for the mouse what to do to solve it.
    Buddy.move_east()
    Buddy.move_east()
    Buddy.move_east()
    Buddy.take_item()

    # start the game with the solution
start_game(solution)

Here, Buddy represents the mouse, and the function solution contains the actions Buddy needs to do to solve the puzzle.

At this point, when the game window pops up, press SPACE, and you will see the mouse doing exactly what you said. When the mouse stops, if the solution was correct, the mouse background turns green and the game will print a message like this:

GAME OVER
Congrats Sarah, You solved level 1!
Your password for level 2 is d099e9d7
(press Q to quit.)

Congratulatons! You can close the game window now to end the game.

Next level

Since you won level 1, you got a password to play level 2: d099e9d7 All you need to do is pass the password to the start_game function, like this:

start_game(solution, password="d099e9d7")

Hint you can use Buddy.set_speed() to increese the speed of the mouse.

And now you have a new puzzle to solve, have fun!

Keyboard

You can move the mouse using the keyboard. Navigate through the puzzle, and try your solutions. However, advancement to the subsequent level requires solving it solely with code."

Here is a list of keys and their respective mouse actions:

  • Arrow keys: move the mouse 1 step in the arrow direction
  • F: move the mouse 1 step forward (in the direction of the white bump)
  • R: rotate the mouse direction 90 degrees to the right
  • L: rotate the mouse direction 90 degrees to the left
  • G: grab the item in the current mouse cell (if any)
  • D: drop the currently carried item (if any)

Credits

CheesePy is developed and maintained by Prof. Marco Pascucci @ The american University of Paris

The game is developed with pygame.

Special thanks to the developers of the labirinth-py for sharing this very qualitative and well written package, used in cheesepygame to generate mazes.


Metadata

Release files for cheesepy-game 1.1.30

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cheesepy-game 1.1.30
File Size Uploaded Provenance Actions
cheesepy_game-1.1.30.tar.gz 43.5 kB Without provenance Details for cheesepy_game-1.1.30.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cheesepy-game 1.1.30
File Interpreter ABI Platform Actions
cheesepy_game-1.1.30-py3-none-any.whl Python 3 none any Details for cheesepy_game-1.1.30-py3-none-any.whl

Total release size: 89.6 kB

Release files / cheesepy_game-1.1.30.tar.gz

Download URL cheesepy_game-1.1.30.tar.gz
Size 43.5 kB
Tags Source
SHA-256 checksum
How to use checksums
20352b4614006bf8e27129dcfcb2cea79f8acfeb84c7a25fe27dd9d04434688b
BLAKE2b-256 checksum
How to use checksums
3d9aad448c467552c6504e0b92f4ab544e9edb4b04d22965aacebdab7d992b53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Release files / cheesepy_game-1.1.30-py3-none-any.whl

Download URL cheesepy_game-1.1.30-py3-none-any.whl
Size 46.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fe60c7cbec61e8dce5586313fa9c76b2bd3d6c358a204d0b0ccc52bc984f1ce
BLAKE2b-256 checksum
How to use checksums
963974db0d05839ff1b745ad87fb3e9eaeda83e1f654523d9a95897d2ecfcdd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.12

Security for cheesepy-game 1.1.30

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page