Skip to content

xmojtabw/AI-Tetris

Repository files navigation

🕹️ Tetris AI Agents: Genetic Algorithm & Simulated Annealing

Welcome to the Tetris AI Agents project! This repository contains two intelligent agents designed to tackle the classic game of Tetris using Genetic Algorithm (GA) and Simulated Annealing (SA). These AI strategies aim to optimize gameplay by efficiently placing Tetriminos to maximize score and minimize game-over scenarios.

🚀 Features

  • 🧬 Genetic Algorithm (GA): Evolves a population of AI agents by applying selection, mutation, and crossover to enhance performance over generations.
  • ❄️ Simulated Annealing (SA): Uses a probabilistic approach to explore and exploit board states, optimizing moves dynamically.

🏗️ Installation

Ensure you have Python installed (>=3.7). Then, install dependencies:

pip install -r requirements.txt

🔧 Usage

Run the agents and watch them play Tetris:

python main.py gen  # Run Genetic Algorithm agent
python main.py sa  # Run Simulated Annealing agent

Made with ❤️ for AI and Tetris enthusiasts!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages