Skip to content

cognitivecomputations/PyQuest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 

Repository files navigation

PyQuest

An interactive, REPL-native journey to learn Python by doing.
Inspired by Gameshell, but designed entirely within the Python REPL.


πŸ“œ What Is This?

PyQuest is a gamified curriculum that teaches Python from the inside out β€” through hands-on problem-solving, inside the Python REPL. Each level presents a challenge. When you solve it, you advance. Your progress is saved automatically.


πŸš€ Getting Started

1. Clone the repo

git clone https://github.com/cognitivecomputations/pyquest.git
cd pyquest

2. Start Python REPL

python

3. Start the game

Inside the REPL:

from game.engine import start_game
start_game()

🧠 How It Works

  • Each level is a separate Python file located in levels/.
  • When the level loads, it calls print_goal() to display your objective.
  • You solve the challenge using Python code in the REPL.
  • Run check() to test your solution.
  • If correct, you automatically advance to the next level.
  • Your progress is saved in save/player_progress.json.

πŸ“¦ Project Structure

pyreplquest/
β”‚
β”œβ”€β”€ game/                # Core game engine
β”‚   β”œβ”€β”€ engine.py
β”‚   β”œβ”€β”€ state.py
β”‚   └── ...
β”‚
β”œβ”€β”€ levels/              # One Python file per level
β”‚   β”œβ”€β”€ level01.py
β”‚   β”œβ”€β”€ level02.py
β”‚   └── ...
β”‚
β”œβ”€β”€ save/                # Stores progress
β”‚   └── player_progress.json
β”‚
β”œβ”€β”€ main.py              # (Optional) Entry point
└── README.md

πŸ“˜ Sample Level

Here’s what a typical level file looks like (levels/level01.py):

def print_goal():
    print("Define a variable `name` with your name as a string.")

def check_complete(state):
    return isinstance(state.get("name"), str) and len(state["name"]) > 0

You’d solve it like this in the REPL:

>>> name = "Ada"
>>> check()
βœ… Level complete!

🎯 Learning Progression

PyREPLQuest starts with basic syntax, and gradually builds toward real-world projects like:

  • File I/O (text, JSON, CSV)
  • Data transformation (ETL)
  • Search and sort algorithms
  • Visualization with matplotlib
  • Simple Flask web apps
  • SQLite database operations

All playable entirely from the REPL.


πŸ›  Requirements

  • Python 3.8+

  • No external dependencies until charting/web levels

  • Install optional libraries for advanced levels:

    pip install matplotlib flask requests

πŸ§‘β€πŸ’» Who Is This For?

  • Homeschooling parents or educators
  • Kids, teens, or adults learning Python
  • REPL lovers
  • Fans of Gameshell-style learning

πŸ“… License

MIT License. Designed to be forked, modified, and shared.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published