This is a terminal-based Python challenge that guides you through various coding challenges from beginner to advanced level. The challenges are organized into chapters, and each chapter contains challenges sorted by difficulty level.
- Colorized output for solved and unsolved challenges
- Progress tracking for each chapter and overall progress
- Ability to change the default text editor
- Automatic testing of user solutions with test cases
- Non-OOP challenges: Check against expected outputs
- OOP challenges: Run unit tests defined in
test_cases.py
- Persistent progress tracking across multiple sessions
- Python 3.x
colorama
library (install withpip install colorama
)
- Clone or download the repository to your local machine.
- Navigate to the project directory.
- Run the script with
python main.py
. - Follow the on-screen instructions to navigate through the chapters and challenges.
- Navigate to the repository on GitHub.
- Click on the "Code" button and select "Codespaces" from the dropdown menu.
- Choose to create a new codespace or reuse an existing one.
- Once the codespace is ready, open the terminal and run
python main.py
. - Follow the on-screen instructions to navigate through the chapters and challenges.
If you'd like to contribute to this project, you can:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
When contributing, please follow these guidelines:
- Follow the existing code style and formatting.
- Write clear and concise commit messages.
- Ensure that your changes don't break existing functionality by running the tests.
- If you're adding new features or making significant changes, update the documentation accordingly.
The project has the following structure:
project_directory/ ├── challenges/ │ ├── Chapter 1/ │ │ ├── challenge_1/ │ │ │ ├── challenge.json │ │ │ └── solution.py │ │ ├── challenge_2/ │ │ │ ├── challenge.json │ │ │ └── solution.py │ │ ├── ... │ └── Chapter 2 - OOP/ │ ├── challenge_1/ │ │ ├── challenge.json │ │ ├── solution.py │ │ └── test_cases.py │ ├── challenge_2/ │ │ ├── challenge.json │ │ ├── solution.py │ │ └── test_cases.py │ └── ... ├── main.py ├── preferences.json ├── progress.json └── requirements.txt
To add a new challenge, follow these steps:
- Create a new directory for the challenge inside the appropriate chapter directory (e.g.,
challenges/Chapter 1/challenge_3
). - Inside the challenge directory, create a
challenge.json
file and asolution.py
file. - In the
challenge.json
file, define the challenge details, such as the name, description, difficulty level, and test cases (for non-OOP challenges).
Example challenge.json
file:
{
"name": "Reverse String",
"description": "Write a function that takes a string as input and returns the reverse of that string.",
"difficulty_level": "Beginner",
"test_cases": [
{
"input": "hello",
"expected_output": "olleh"
},
{
"input": "Python",
"expected_output": "nohtyP"
}
]
}