diff --git a/README.md b/README.md index 391df08..2a864a7 100755 --- a/README.md +++ b/README.md @@ -2,20 +2,58 @@ ## Description - +This project is our attempt at making an AI that can play Tetris. First of all we made the environment (the game itself) and then we started working on multiple AI's that can play the game. The AI's are based on different algorithms and strategies. We have implmented: -## Setup -### Prerequisites -- Ensure that git is installed on your machine. [Download Git](https://git-scm.com/downloads) -- Ensure Python 3.12 or newer is installed on your machine. [Download Python](https://www.python.org/downloads/) +- Random agent +- Heuristic agent with set weights +- Genetic algorithm to find the best weights for the heuristic agent + +The game is playable/viable both in the terminal and in a GUI. The GUI is made with Pygame. + +## How to run and install + +- Have python installed (tested with 3.10+ but should work on older versions as well) +- Have pip installed +- Clone the repository +- Set up a virtual environment (optional but recommended) see [here](docs/guide/venv.md) for a guide +- Install the required packages with pip + +```bash +pip install -r requirements.txt +``` + +- Done! You are now ready to run the game -### Clone the repository ```bash git clone https://github.com/CogitoNTNU/TetrisAI.git cd TetrisAI ``` -## Contributors +## Usage + +To play the game yourself, run the following command: + +```bash +python main.py --play +``` + +To let the agent play the game, run the following command: + +```bash +python main.py --agent +``` + +where `` is the agent you want to use. The available agents are: `random`, `heuristic`, `genetic` + +To train the genetic agent, run the following command: + +```bash +python main.py --train +``` + +## Team + +The team behind this project is a group of students at NTNU in Trondheim, Norway, developed during the spring semester of 2024. The team consists of: @@ -63,3 +101,5 @@ cd TetrisAI
+ +![Group picture](docs/img/Team.png)