All Projects → Loonride → tetris-ai

Loonride / tetris-ai

Licence: other
A Tetris AI written in JavaScript that uses a genetic algorithm

Programming Languages

javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language
CSS
56736 projects
HTML
75241 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to tetris-ai

GA
An R package for optimization using genetic algorithms
Stars: ✭ 76 (+245.45%)
Mutual labels:  genetic-algorithm
goga
Go evolutionary algorithm is a computer library for developing evolutionary and genetic algorithms to solve optimisation problems with (or not) many constraints and many objectives. Also, a goal is to handle mixed-type representations (reals and integers).
Stars: ✭ 39 (+77.27%)
Mutual labels:  genetic-algorithm
GeneticsJS
Evolutionary algorithms library for the web 🧬
Stars: ✭ 25 (+13.64%)
Mutual labels:  genetic-algorithm
pikaia
Modern Fortran Edition of the Pikaia Genetic Algorithm
Stars: ✭ 29 (+31.82%)
Mutual labels:  genetic-algorithm
Tetris
A (incomplete) terminal Tetris. Written in Haskell.
Stars: ✭ 26 (+18.18%)
Mutual labels:  tetris
Tetris AR
An AR Tetris (unity3d+vuforia)
Stars: ✭ 14 (-36.36%)
Mutual labels:  tetris
modest-py
FMI-compliant Model Estimation in Python
Stars: ✭ 40 (+81.82%)
Mutual labels:  genetic-algorithm
ai-n-queens
Solving and GUI demonstration of traditional N-Queens Problem using Hill Climbing, Simulated Annealing, Local Beam Search, and Genetic Algorithm.
Stars: ✭ 30 (+36.36%)
Mutual labels:  genetic-algorithm
GA-Toolbox
Genetic Algorithms Toolbox
Stars: ✭ 41 (+86.36%)
Mutual labels:  genetic-algorithm
Flow-Shop-Scheduling
Genetic Algorithm for Flow Shop Scheduling
Stars: ✭ 19 (-13.64%)
Mutual labels:  genetic-algorithm
TorchGA
Train PyTorch Models using the Genetic Algorithm with PyGAD
Stars: ✭ 47 (+113.64%)
Mutual labels:  genetic-algorithm
nvim-tetris
Bringing emacs' greatest feature to neovim - Tetris!
Stars: ✭ 114 (+418.18%)
Mutual labels:  tetris
gene-oracle
Feature extraction algorithm for genomic data
Stars: ✭ 13 (-40.91%)
Mutual labels:  genetic-algorithm
CppTetris
Tetris made within an hour
Stars: ✭ 104 (+372.73%)
Mutual labels:  tetris
Mathematical-Modeling
A sharing of the learning process of mathematical modeling 数学建模常用工具模型算法分享:数学建模竞赛优秀论文,数学建模常用算法模型,LaTeX论文模板,SPSS工具分享。
Stars: ✭ 30 (+36.36%)
Mutual labels:  genetic-algorithm
mimstris
A falling block puzzle game created using React and Redux.
Stars: ✭ 129 (+486.36%)
Mutual labels:  tetris
ai-plays-flappybird
Using genetic algorithm and neural networks to teach AI to play flappy bird.
Stars: ✭ 58 (+163.64%)
Mutual labels:  genetic-algorithm
fumen-for-mobile-ts
Tetris diagram editor for mobile
Stars: ✭ 14 (-36.36%)
Mutual labels:  tetris
Job-Shop-Scheduling-Genetic-Algorithm
Job Shop Scheduling Solver using Genetic Algorithyms
Stars: ✭ 48 (+118.18%)
Mutual labels:  genetic-algorithm
evoli
Genetic Algorithm and Particle Swarm Optimization
Stars: ✭ 22 (+0%)
Mutual labels:  genetic-algorithm

Video: https://youtu.be/pXTfgw9A08w

Interactive Demo: https://loonride.github.io/tetris-ai/public/

Tetris AI

This is a Tetris AI written in JavaScript. It was optimized using a genetic algorithm, but can often only achieve 1000-2000 lines per game. It is still in development, so hopefully we will soon reach the perfect Tetris AI!

This project is unique in that I will not give the AI knowledge of the next piece. It has already been proven that next piece knowledge is highly advantageous. I have not implemented T-Spins or other complex Tetris moves, but I will probably do so eventually.

The AI uses the following parameters to determine how good a move is:

  • Hole count
  • Bumpiness
  • Lines Cleared

Among some other minor parameters.

alt text

Screenshots:

alt text

Contributing

Any contributions are welcome. Please join my Discord to learn more: https://discord.gg/Sfbg2Sh

Development & Training

Before developing, you will need Node.js and npm installed.

To develop this project, clone this repository, then go into the training directory and type:

npm install

From there, you can do

npm train

to run the genetic algorithm. Data is outputted in the data folder.

Running Demo Locally

If you want to run the demo, install the global module live-server like this:

npm install -g live-server

Then go into the public directory and do:

live-server

Sources that I built off of

tetris-js: https://github.com/simon-tiger/tetris-js

genetic-js: https://github.com/subprotocol/genetic-js

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].