Skip to content

Latest commit

 

History

History
345 lines (269 loc) · 11.1 KB

File metadata and controls

345 lines (269 loc) · 11.1 KB

🐍 پایتون‌باز | Python Baz

یادگیری پایتون با بازی و چالش | Learn Python Through Games & Challenges

Python Game Lab Web MIT Active Live Demo


🎮 پایتون‌باز چیه؟

یه بازی آنلاین برای یادگیری پایتون از صفر با حالت آرکید! هر فصل شامل آموزش، تمرین و چالش هست. با حل کردن چالش‌ها ایکس‌پی بگیر، سطحت بالا بره، و فصل‌های بعدی باز بشه!

🔗 بازی آنلاین پایتون‌باز

✨ امکانات

امکان توضیح
📖 آموزش ساده هر فصل با توضیح ساده و مثال شروع میشه
🎯 چالش‌های متنوع پیش‌بینی خروجی، شکار باگ، جای خالی، چندگزینه‌ای
💾 ذخیره پیشرفت از هرجا ادامه بده، پیشرفتت از بین نمیره
🔊 صدا و افکت تجربه بازی با صدا و انیمیشن
📱 ریسپانسیو روی موبایل و دسکتاپ کار میکنه
🔒 سطح‌بندی فصل‌ها قفل هستن و باید فصل قبلی رو تموم کنی
🌙☀️ حالت تاریک/روشن تم دلخواهت رو انتخاب کن
🏅 XP و لِوِل سیستم ایکس‌پی بازی‌وار با سطح‌بندی پیشرفت
🔥 روزانه‌ی پیاپی هر روز وارد شو تا استریک روزانه‌ات حفظ بشه
⚡ انرژی سیستم انرژی برای مدیریت بازی روزانه
📋 ماموریت‌های روزانه کوئست‌های روزانه با پاداش ایکس‌پی
🛒 فروشگاه بازی آیتم‌ها و اسکین‌های قابل خرید با ایکس‌پی
👤 پروفایل صفحه پروفایل با آمار و دستاورد‌ها
⚙️ تنظیمات صفحه تنظیمات با شخصی‌سازی
📖 واژه‌نامه پایتون ۳۷ کلمه کلیدی با توضیح فارسی
🔍 جستجوی فصل سریع فصل مورد نظرت رو پیدا کن
⏱️ تایمر چالش چالش‌ها رو با تایمر حل کن
📊 پیشرفت کلی نوار پیشرفت + آمار کامل

📸 اسکرین‌شات‌ها

به‌زودی اضافه می‌شه...

📚 فصل‌ها

📗 مبتدی

شروع یادگیری

فصل
۱ متغیرها
۲ عملگرها

📘 متوسط

عمیق‌تر شو!

فصل
۳ شرط‌ها
۴ حلقه‌ها
۵ توابع

📕 پیشرفته

حرفه‌ای شو!

فصل
۶ لیست‌ها
۷ دیکشنری‌ها
۸ متدهای رشته
۹ مدیریت فایل
۱۰ مدیریت خطا

🎓 حرفه‌ای

استاد شو!

فصل
۱۱ شی‌گرایی
۱۲ جنریتورها
۱۳ دکوراتورها
۱۴ ماژول‌ها
۱۵ عبارات باقاعده
۱۶ فریم‌ورک‌ها
۱۷ پایتون در عمل
۱۸ توابع لامبدا
۱۹ لیست کامپریهنشن
۲۰ محیط مجازی
۲۱ پایگاه داده
۲۲ API و اینترنت
۲۳ تست‌نویسی

# 🐍 Python Baz

Learn Python Through Games & Challenges

Python Game Lab Web MIT Active Live Demo


🎮 What is Python Baz?

An online game for learning Python from scratch with an arcade experience! Each chapter includes lessons, exercises, and challenges. Earn XP, level up, and unlock new chapters!

🔗 Play Python Baz Online

✨ Features

Feature Description
📖 Simple Lessons Each chapter starts with easy explanations and examples
🎯 Various Challenges Predict output, bug hunting, fill-in-the-blank, multiple choice
💾 Save Progress Resume from anywhere, your progress is saved locally
🔊 Sound & Effects Game experience with sounds and animations
📱 Responsive Works on mobile and desktop
🔒 Level System Chapters are locked — complete previous ones to unlock
🌙☀️ Dark/Light Mode Choose your preferred theme
🏅 XP & Levels Arcade-style XP system with progression
🔥 Daily Streak Log in daily to maintain your streak
⚡ Energy Energy system for daily gameplay management
📋 Daily Quests Daily quests with XP rewards
🛒 In-Game Shop Buy items and skins with XP
👤 Profile Profile page with stats and achievements
⚙️ Settings Settings page with customization
📖 Python Glossary 37 key terms with Persian descriptions
🔍 Chapter Search Find any chapter instantly
⏱️ Challenge Timer Complete challenges against the clock
📊 Progress Tracking Overall progress bar + detailed stats

📸 Screenshots

Coming soon...

📚 Chapters

📗 Beginner

Start learning

Chapter
1 Variables
2 Operators

📘 Intermediate

Go deeper!

Chapter
3 Conditionals
4 Loops
5 Functions

📕 Advanced

Pro level!

Chapter
6 Lists
7 Dictionaries
8 String Methods
9 File Handling
10 Error Handling

🎓 Expert

Master it!

Chapter
11 OOP
12 Generators
13 Decorators
14 Modules
15 Regex
16 Frameworks
17 Python in Practice
18 Lambda Functions
19 List Comprehension
20 Virtual Environments
21 SQLite Database
22 API & HTTP
23 Testing with pytest

🚀 Getting Started

🎮 Play Online (No Install Needed)

🔗 Play Python Baz Online

💻 Run Locally

# Clone the repo
git clone https://github.com/erpycode/python-baz.git

# Go to directory
cd python-baz

# Start local server
python3 -m http.server 8080

# Open browser → http://localhost:8080

📁 Project Structure

python-baz/
├── index.html              # Main page (SPA entry)
├── css/
│   ├── tokens.css          # Design tokens (colors, spacing, etc.)
│   ├── base.css            # Base/reset styles
│   ├── arcade.css          # Arcade theme & gamification styles
│   ├── components.css      # Reusable UI components
│   └── pages.css           # Page-specific styles
├── js/
│   ├── app.js              # SPA router + main entry
│   ├── router.js           # Hash-based router
│   ├── state.js            # Global state management (versioned)
│   ├── migration.js        # Legacy data migration
│   ├── views/
│   │   ├── home.js         # Home/dashboard view
│   │   ├── map.js          # Chapter map view
│   │   ├── lesson.js       # Lesson view
│   │   ├── exercises.js    # Exercises view
│   │   ├── challenges.js   # Challenge view
│   │   ├── result.js       # Result/score view
│   │   ├── profile.js      # Profile page
│   │   └── settings.js     # Settings page
│   ├── systems/
│   │   ├── xp.js           # XP & level system
│   │   ├── streak.js       # Daily streak tracking
│   │   ├── energy.js       # Energy system
│   │   ├── quests.js       # Daily quests
│   │   ├── shop.js         # In-game shop
│   │   └── sound.js        # Sound effects (Web Audio API)
│   ├── utils.js            # Helper functions
│   ├── glossary.js         # Python glossary (37 terms)
│   └── search.js           # Chapter search filter
├── data/
│   ├── chapter_1.json      # 📗 Variables
│   ├── ...                 # (23 chapters total)
│   └── chapter_23.json     # 🎓 Testing with pytest
├── .github/
│   └── workflows/
│       └── deploy.yml      # GitHub Pages deployment
├── .nojekyll               # Bypass Jekyll processing
├── DESIGN.md               # Design documentation
└── README.md

🏗️ Architecture

SPA Router

Hash-based routing (#/home, #/map, #/lesson/1, etc.) with view-based rendering. No page reloads.

State Management

Versioned state in localStorage with automatic migration when upgrading. Stores XP, streaks, energy, quests, shop inventory, and chapter progress.

Views Pattern

Each page is a self-contained view module (views/*.js) that renders into the main content area.

Gamification Systems

  • XP/Level: Earn XP from challenges; level up with progression
  • Daily Streak: Login consecutive days for bonus rewards
  • Energy: Regenerate over time; spend on activities
  • Daily Quests: Fresh challenges every day
  • Shop: Spend XP on cosmetics and boosts

🤝 Contributing

Contributions are welcome!

  1. 🍴 Fork the repo
  2. 🌿 Create a feature branch
  3. ✏️ Commit changes
  4. 📤 Push to branch
  5. 🔀 Open a Pull Request

📝 Adding a New Chapter

Create a new JSON file in the data/ folder and add its name to js/app.js. See DESIGN.md for details.

📄 License

MIT License


Made with ❤️ by ErPyCode