Thank you for your interest in contributing. This guide will help you get started.
Welcome. If you're new to open source, this is a great place to start.
- Learn the basics: Read the README.md to understand what the project does
- Run the code: Execute
python main.pyto see it in action - Pick a task: Check the "Good First Issues" below
- Ask questions: Don't hesitate to ask if something is unclear
These are suitable for newcomers:
Difficulty: Easy
Edit example_mazes.py and add a new function:
def get_my_maze():
"""
Returns a custom maze - describe it here!
"""
return [
['S', 0, 0, 1, 0],
[1, 1, 0, 1, 0],
[0, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[0, 0, 0, 0, 'E']
]Then add it to the MAZE_EXAMPLES dictionary.
Difficulty: Easy
Add more comments explaining how the code works. Look for sections that could be clearer.
Difficulty: Medium
Add checks to ensure:
- Mazes have exactly one Start and one End
- All rows have the same length
- Only valid characters (0, 1, 'S', 'E') are used
Difficulty: Advanced
Create bfs_solver.py similar to dfs_solver.py but using Breadth-First Search instead. BFS uses a queue and finds the shortest path.
# Fork the repo on GitHub, then:
git clone https://github.com/YOUR_USERNAME/maze_solver.git
cd maze_solvergit checkout -b feature/your-feature-nameUse prefixes like:
feature/for new featuresbugfix/for bug fixesdocs/for documentationrefactor/for code improvements
- Write clean, readable code
- Add comments for complex logic
- Test your changes thoroughly
python main.pyMake sure:
- The program runs without errors
- Your changes work as expected
- You didn't break existing functionality
git add .
git commit -m "Add: brief description of your changes"Good commit messages:
Add: new spiral maze exampleFix: handle empty maze edge caseDocs: explain DFS algorithm in READMERefactor: simplify neighbor calculation
git push origin feature/your-feature-nameThen go to GitHub and create a Pull Request.
# Good variable names
path_length = 10
is_valid = True
# Bad variable names
x = 10
flag = True
# Good function with docstring
def calculate_distance(point1, point2):
"""
Calculate Euclidean distance between two points.
Args:
point1: Tuple of (x, y) coordinates
point2: Tuple of (x, y) coordinates
Returns:
Float representing the distance
"""
# Implementation here
pass
# Good spacing
def solve_maze(maze):
if not maze:
return None
result = dfs_search(maze)
return result- Add docstrings to all functions and classes
- Explain why, not just what
- Use examples when helpful
# Good comment - explains WHY
# We use DFS because it uses less memory than BFS for deep mazes
# Bad comment - just repeats code
# Set x to 5
x = 5- Fix typos in documentation
- Add more example mazes
- Improve code comments
- Add error messages
- Add input validation
- Create utility functions
- Add statistics/metrics
- Write tutorials
- Implement new algorithms (BFS, A*, Dijkstra)
- Add maze generation
- Create visualizations
- Performance optimizations
- Add GUI
Before submitting, ensure:
- Code runs without errors
- Changes are tested
- Documentation is updated
- Code follows style guidelines
- Commit messages are clear
- PR description explains the changes
- Code questions: Open an issue with the "question" label
- Bug reports: Open an issue with the "bug" label
- Feature ideas: Open an issue with the "enhancement" label
Be respectful and inclusive. We're all here to learn and help each other!
- Be kind and patient with newcomers
- Give constructive feedback
- Respect different skill levels
- Help others when you can
All contributors will be recognized. Your contributions help everyone learn.
Thank you for contributing to Maze Solver.