Skip to content

kamberasaf/oop-aquarium

Repository files navigation

The OOP Aquarium

An object-oriented Python aquarium simulation featuring four types of animals: two fish types (Scalar and Moly) and two crab types (Ocypode and Shrimp).

Features

  • 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

Getting Started

Prerequisites

  • Python 3.x installed on your system

Running the Project

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

How to Use

  • 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)

Example

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

Aquarium Demo

Examples

To see how animals can be added programmatically:

python examples/add_animals_example.py

Running Tests

Tests are located in the tests/ directory and use pytest. To run the tests:

pip install pytest
pytest tests/

About

Interactive object-oriented aquarium simulator featuring fish and crabs with customizable behavior.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages