Tetris Solver: GA & Simulated Annealing

Tetris Solver: GA & Simulated Annealing

external-link

Sep 2025

Finished

This project implements a modern version of Tetris in Unity alongside two metaheuristic algorithms to autonomously solve piece placement: a Genetic Algorithm (GA) and Simulated Annealing (SA). The objective is finding the best arrangement for a sequence of pieces that minimizes the occupied board space. Each candidate solution encodes a sequence of piece movements. A custom fitness function evaluates the final board state. Both algorithms run extensive iteration-based experiments with configurable hyperparameters. A solution visualizer replays the best found placements in real-time during computation. The companion Python analysis module parses execution logs to generate detailed performance plots comparing GA vs SA across different configurations. A full research paper documents all implementation details, experiments, and decisions made.

Technologies
ai

AI

c-sharp

C Sharp

jupyter

Jupyter

latex

LaTeX

matplot

Matplot

pandas

Pandas

plotly

Plotly

python

Python

unity

Unity

https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image_169.webp?v=e83cd7f5b5569a2b45eb67b432d69897dd367fab
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (1)_169.webp?v=4264f38115545c16e8e8e94d51b67710bbd36c2b
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (2)_169.webp?v=dc19515ce80dd0f3f4369df8d82a4796f1b713e9
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (3)_169.webp?v=dadf6963b9b5d63a77a27df3c9367ce182938980
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (4)_169.webp?v=1c937692c5d3414d11251d567e3f827140db1475
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (5)_169.webp?v=d0ed4c3409643bc890ebf4d0548d16d672852d0e
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (6)_169.webp?v=3c34421ae5fdc2753f0b96e8fe31af35b2c33ddc
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image_169.webp?v=e83cd7f5b5569a2b45eb67b432d69897dd367fab
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (1)_169.webp?v=4264f38115545c16e8e8e94d51b67710bbd36c2b
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (2)_169.webp?v=dc19515ce80dd0f3f4369df8d82a4796f1b713e9
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (3)_169.webp?v=dadf6963b9b5d63a77a27df3c9367ce182938980
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (4)_169.webp?v=1c937692c5d3414d11251d567e3f827140db1475
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (5)_169.webp?v=d0ed4c3409643bc890ebf4d0548d16d672852d0e
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (6)_169.webp?v=3c34421ae5fdc2753f0b96e8fe31af35b2c33ddc
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image_169.webp?v=e83cd7f5b5569a2b45eb67b432d69897dd367fab
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (1)_169.webp?v=4264f38115545c16e8e8e94d51b67710bbd36c2b
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (2)_169.webp?v=dc19515ce80dd0f3f4369df8d82a4796f1b713e9
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (3)_169.webp?v=dadf6963b9b5d63a77a27df3c9367ce182938980
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (4)_169.webp?v=1c937692c5d3414d11251d567e3f827140db1475
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (5)_169.webp?v=d0ed4c3409643bc890ebf4d0548d16d672852d0e
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (6)_169.webp?v=3c34421ae5fdc2753f0b96e8fe31af35b2c33ddc
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image_169.webp?v=e83cd7f5b5569a2b45eb67b432d69897dd367fab
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (1)_169.webp?v=4264f38115545c16e8e8e94d51b67710bbd36c2b
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (2)_169.webp?v=dc19515ce80dd0f3f4369df8d82a4796f1b713e9
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (3)_169.webp?v=dadf6963b9b5d63a77a27df3c9367ce182938980
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (4)_169.webp?v=1c937692c5d3414d11251d567e3f827140db1475
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (5)_169.webp?v=d0ed4c3409643bc890ebf4d0548d16d672852d0e
https://raw.githubusercontent.com/MiquelGomezCorral/TetrisSolver/main/readme_images/image (6)_169.webp?v=3c34421ae5fdc2753f0b96e8fe31af35b2c33ddc