This contains a python project I did using classes and object oriented programming based on the game of life. It is named Game of Cats. The files required for the program are included in the program files folder. cats.py , main.py , terrain.csv.
Simulation Game of Cats, assignment of Fundamentals of Programming COMP1005/5005
author - Hikkaduwage Pasindu Laksara Fernando 20502557
cats.py (main class program) main.py (controller program) README terrain.csv
README - readme file for Simulation Game of Cats.
The files required for the program are included in the program files folder. cats.py , main.py , terrain.csv. The README.txt file contains information regarding the version of the program. 1.The first step is to install numpy if you haven’t. If you have installed anaconda using bash you should be good to go. 2.The next step is to go to the terminal window once u have navigated into program files. 3.Then run the command python3 main.py This should run the program. User inputs; IN TOTAL 6 USER INPUTS for greater interactivity. IMPORTANT – Please enter the gride file name, it has to be in a grid format this is made sure through Exceptional handling. The csv file should be named terrain.csv and has to be in same directory as the program files. ( THIS STEP WAS TAKEN TO AVOID ANY WRONG CSV FILES BEING ENTERED AS INPUT TO GRID)
1.Then when prompted please enter the number of each cat species you wish to see. ( Initial Population input) 2.Also enter the timesteps the time of simulation will be in hours preferable 24hrs 3. Also enter the type of neighboorhood you want for the cat to move in Then you will see the simulation run. The Simulation Stats will be in the terminal window; The simulation grid will show the cats simulation. The last grid state will be saved as png into your program directory.
Program files folder -|
|
|- mains.py
|-cats.py
|-terrain.csv
|
|-README.txt
Imported Imported matplotlib.pyplot Imported numpy as np Imported Random
11th October 2021 - initial version of Simulation Game of cats Programs
none