An object-oriented Python aquarium simulation featuring four types of animals: two fish types (Scalar and Moly) and two crab types (Ocypode and Shrimp).
- Add animals with customizable attributes (name, age, location, direction)
- Simulate animal movement in a 2D aquarium environment
- Feed all animals at once
- Step through the simulation turn-by-turn or multiple steps at a time
- Print a live board display of the aquarium state
- Demo mode showcasing the functionality with predefined animals
- Python 3.x installed on your system
Clone the repository and run the main program:
git clone https://github.com/kamberasaf/The-OOP-aquarium.git
cd The-OOP-aquarium
python main.py
- When prompted, enter the aquarium dimensions (width >= 40, height >= 25)
- Use the main menu to add animals, feed them, advance simulation steps, or run the demo
- Follow input instructions carefully for adding animals (name, age, position, direction)
Welcome to "The OOP Aquarium"
The width of the aquarium (Minimum 40): 50
The height of the aquarium (Minimum 25): 30
Main menu
------------------------------
1. Add an animal
2. Drop food into the aquarium
3. Take a step forward
4. Take several steps
5. Demo
6. Print all
7. Exit
What do you want to do? 5
To see how animals can be added programmatically:
python examples/add_animals_example.py
Tests are located in the tests/ directory and use pytest. To run the tests:
pip install pytest
pytest tests/