El-Tetris in HTML5. See it in action!

Following up on my previous post on the El-Tetris algorithm, a Tetris player that clears 16 million rows on average per Tetris game and, at the time of this writing, is the most performant one-piece Tetris AI out there, I thought I would provide an implementation, rather than just a description of the algorithm.

This algorithm is implemented fully in Javascript and the rendering is done in HTML5 canvas. The rendering is purely for cosmetic reasons (so you can actually see how the game is progressing). If you're only interested in the final score, you can choose to speed up the game by enabling "Hardcore Mode". In that mode, rendering the board will be disabled and the algorithm will run continuously in the background. You can also change the size of the board; the smaller the board, the shorter the game.

Full source code can be found here.

Note: For faster execution, use Google Chrome.

4 thoughts on “El-Tetris in HTML5. See it in action!”

  1. I just made a java version of this, which still doesn’t work as well as yours, as it goes game over after about 100-400 lines cleared. I probably have some mistakes calculating the number of wells, transitions and such, which make that the optimal values you calculated are put in wrong perspective of course. Anyhow, my goal is to plug this in a reinforcement network, which will determine the numbers for me.

    If anyone has interrest, e-mail, google or whatever me, the project is closed source atm.

  2. Hi, is anywhere avilable the description, of the Pierre Dellacherie’ tetris algorithm?
    I mean a published paper, or a document that describe the methodology behind the algorithm?

Leave a Reply

Your email address will not be published. Required fields are marked *