Skip to content

rimakogni/py-mars-rover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mars Rover πŸš€

Note: This is a Python implementation of the classic Mars Rover problem. It processes string input, controls rovers on a grid plateau, and avoids collisions.

✨ Project Overview

This project simulates rovers landing on Mars and navigating a plateau grid.

  • Rotate left or right
  • Move forward
  • Check plateau boundaries
  • Avoid collisions

Architecture separates:

  • Domain Models (data classes and enums)
  • Input Parsers
  • Logic Layer (movement, collisions, mission control)
  • Integration Layer (main.py entry point)

πŸ“‚ Project Structure

py-mars-rover/
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ logic/
β”‚   β”œβ”€β”€ parsers/
β”‚   β”œβ”€β”€ utils/
β”‚   └── main.py
β”‚
β”œβ”€β”€ test/
└── README.md

πŸ› οΈ How to Run

  1. Clone the repository:

    git clone https://github.com/yourusername/py-mars-rover.git
    cd py-mars-rover
  2. Create a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the program:

    python src/main.py

Tip

The default input is:

Plateau size: 5 5
Rover position: 1 2 N
Instructions: LMLMMLLMMMR

The expected output:

Rover final position: 0 3 E

βœ… How to Run Tests

Run all tests using:

pytest

πŸ‘©β€πŸ’» Developer Notes

  • Entry point: src/main.py

  • Rover logic: src/logic/rover.py

  • Parsers:

    • PlateauParser
    • PositionParser
    • InstructionParser
  • Customize inputs:

    • Modify main()
    • Or use MissionControl directly

πŸ“„ License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages