Skip to content

TerraSynchrony/PyLearn

Repository files navigation

PyQuest: Codex of Pythonia

An interactive text-based RPG that teaches Python programming from basics to intermediate level. The more Python you learn, the more powerful you become in-game.

How to Play

Option 1: Install with pip (recommended)

pip install git+https://github.com/TerraSynchrony/PyLearn.git
pyquest

Option 2: Clone and run directly

git clone https://github.com/TerraSynchrony/PyLearn.git
cd PyLearn
python run.py

Option 3: Run as a Python module

pip install .
python -m pyquest

No external dependencies — uses only the Python standard library (Python 3.7+).

Game Concept

You are a Code Mage in the land of Pythonia. The ancient Codex of programming knowledge has been shattered into fragments across 10 realms. Defeat monsters ("bugs") by solving Python challenges, level up, and restore the Codex.

Progression System

Tier Rank Zone Python Topics
1 Apprentice Variable Meadows Variables, types, print, arithmetic
2 Acolyte String Caverns Strings, f-strings, string methods
3 Journeyman Boolean Battlements if/else, comparisons, booleans
4 Adept Loop Labyrinth for/while loops, range, break/continue
5 Scholar Collection Catacombs Lists, tuples, indexing, slicing
6 Sage Function Forge Functions, parameters, return, scope
7 Wizard Dictionary Depths Dictionaries, sets
8 Archmage Comprehension Peaks List comprehensions, nested structures
9 Elder OOP Citadel Classes, inheritance, OOP
10 Grandmaster Exception Abyss Try/except, lambda, generators, decorators

Features

  • 77+ Python challenges across 10 difficulty tiers
  • 4 challenge types: multiple choice, code output prediction, fill-in-the-blank, and free-form coding
  • Turn-based combat where solving challenges powers your attacks
  • Streak bonuses reward consecutive correct answers
  • Skill tree unlocked through leveling
  • Shop system with potions, stat boosts, and hint scrolls
  • Practice arena for risk-free learning
  • Built-in Python reference that expands as you unlock tiers
  • Save/load system (JSON-based)
  • Boss battles guarding each zone's Codex fragment

File Structure

pyproject.toml  — Package config (pip installable)
run.py          — Standalone entry point
pyquest/        — Installable package
  __init__.py   — Package metadata
  __main__.py   — python -m pyquest entry point
  game.py       — Main game loop and orchestration
  player.py     — Player stats, XP, leveling, skills
  challenges.py — All Python challenges organized by tier
  combat.py     — Combat system and monster definitions
  world.py      — Zones, shop, story text
  ui.py         — Terminal display utilities
test_pyquest.py — Test suite (80 tests)

About

Learn basic to intermediate Python as you are guided through the process of making your own text based RPG!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages