A lightweight, terminal-based coding practice platform for Python.
Microcodedojo gives you a fast loop for deliberate practice:
- pick an exercise, 2. code your solution in
work/, 3. run tests, 4. track progress.
- ✅ 73 exercises across 3 difficulty levels (
exercises/*.py) - 🧪 Comprehensive test suites for every exercise (
tests/test_*.py) - 📁 Reference solutions to learn from (
solutions/*.py) - 📊 Progress tracking with automatic scoring (
~/.microcodedojo/progress.json) - 💾 Timestamped backups to protect your work (
~/.microcodedojo/backups/) - 🎯 10 points per solved exercise → 730 points total
# Clone or download the project
cd microcodedojo
# Setup (WSL/Ubuntu)
bash setup.sh
# List all available exercises
python3 run.py list# 1. Create/open your work file
python3 run.py run two_numbers
# 2. Edit work/two_numbers.py in your editor
# 3. Run tests for that exercise
python3 run.py test two_numbers
# 4. Check your progress
python3 run.py stats| Command | Description | Example |
|---|---|---|
list |
List all available exercise ids | python3 run.py list |
run <id> |
Create/open work/<id>.py from template |
python3 run.py run prime_check |
test <id> |
Run unittest and update progress | python3 run.py test prime_check |
solution <id> |
Print path to reference solution | python3 run.py solution prime_check |
stats |
Show score, solved count, attempts | python3 run.py stats |
backup |
Create timestamped backup | python3 run.py backup |
🟢 Beginner (23 exercises)
Basic I/O, arithmetic, simple logic
Examples: two_numbers, sum_range, max_of_three, temperature_convert
🟡 Intermediate (25 exercises)
Strings, lists, data manipulation
Examples: count_vowels, reverse_words, dedupe_keep_order, merge_sorted_lists
🔴 Advanced (25 exercises)
Algorithms, complex logic, problem-solving
Examples: prime_check, fibonacci_n, bracket_balance, two_sum_indices
$ python3 run.py run two_numbers
✅ Ready: work/two_numbers.py
Edit this file, then run:
python3 run.py test two_numbersEdit work/two_numbers.py:
def solve() -> str:
a, b = map(int, input().split())
return str(a + b)
if __name__ == "__main__":
print(solve())Test it:
$ python3 run.py test two_numbers
..
OK
✅ PASS
$ python3 run.py stats
Score: 10
Solved: 1
Attempts: 1Progress is stored in: ~/.microcodedojo/progress.json
Example structure:
{
"version": 1,
"score": 150,
"exercises": {
"two_numbers": {
"solved": true,
"attempts": 1,
"solved_at": "2026-02-15T14:30:00+00:00"
}
}
}Create a backup:
$ python3 run.py backup
✅ Backup created: ~/.microcodedojo/backups/backup_20260215_143022
Backed up 5 item(s):
- progress.json
- work/two_numbers.py
- work/string_info.pyBackups are stored in: ~/.microcodedojo/backups/backup_YYYYMMDD_HHMMSS/
To restore:
# Restore progress
cp ~/.microcodedojo/backups/backup_20260215_143022/progress.json ~/.microcodedojo/
# Restore work files
cp ~/.microcodedojo/backups/backup_20260215_143022/work/*.py work/microcodedojo/
├── run.py # Main CLI tool
├── setup.sh # Setup script
├── README.md # This file
├── exercises/ # Exercise templates (incomplete)
├── solutions/ # Reference solutions (complete)
├── tests/ # Test suites
└── work/ # Your solutions (created on demand)
~/.microcodedojo/ # User data (hidden directory)
├── progress.json # Your progress
└── backups/ # Timestamped backups
Issue: "ModuleNotFoundError: No module named 'tests'"
Solution: Make sure you're in the project root directory
Issue: "Unknown exercise"
Solution: Run python3 run.py list to see available exercises
Issue: Corrupted progress.json
Solution: Run python3 run.py stats - it will auto-repair
Issue: Tests fail but code works manually
Solution: Check for extra whitespace or incorrect output format
# Test specific exercise
python3 -m unittest tests.test_two_numbers
# Test all exercises (from project root)
python3 -m unittest discover tests
# Verify all reference solutions work
bash test_all_solutions.sh- Create template in
exercises/<name>.py - Create solution in
solutions/<name>.py - Create test in
tests/test_<name>.py - Test with:
python3 run.py test <name>
- Python 3.8+
- Unix-like environment (Linux, WSL, macOS)
- Terminal/command line access
Educational use — free to use and modify for learning purposes.
# Setup
bash setup.sh
# Practice
python3 run.py list # Show exercises
python3 run.py run <exercise> # Start exercise
python3 run.py test <exercise> # Test solution
# Progress
python3 run.py stats # View progress
python3 run.py solution <exercise> # See reference
# Safety
python3 run.py backup # Backup your workReady to start? Run python3 run.py list and pick your first exercise! 🚀