Skip to main content

AI Plays Tetris and Beats World Record

Cube, Tetris, Play, Blocks, artificial intelligence
Tetris Game

The ever-growing power of artificial intelligence never stops to amaze us. Now, it sets a mind-blowing world record.


Australian coder Code Bullet created an artificial intelligence program that beat the current world record for the longest Tetris game of 4,988 lines which is currently held by gamer Harry Hong. Even the whole Tetris game was programmed by the coder. It seems impressive to see how he builds everything from scratch and breaks the world record!


What is A.I. Tetris?

Tetris is a tile-matching video game where the goal is to destroy the lines of tiles (or blocks) strategically to prevent them to stack to the top of the screen. Human intelligence supported with artificial intelligence showed some marvelous results for Tetris. The video uploaded by Bullet shows A.I. has cleared about 14,000 lines of the blocks in the game of Tetris. He also mentions in the video that the A.I.-powered game can go up to infinite lines. 


"Playing 'Tetris' for 15 minutes is like meditation."

~ Ezra Koenig


How Does A.I. Tetris Works?

This game works on a simple algorithm that is to pick the best move out of all the possible moves, which is the “backbone” of artificial intelligence. Good moves and bad moves are classified by assigning points depending on some parameters and the one with the highest score is considered the best move (reinforced learning). 

  • Minimize global holes: block spaces that are left empty between or under your pieces and cannot be filled further (these holes are considered bad), will result in fewer points to that move i.e. it will be considered a bad move. So A.I. will optimize itself by selecting the moves which will have least or no spaces left.

  • Minimize the height of stacks: only reducing the holes is not enough, stack height should also be minimum as the purpose is to eliminate complete rows and prevent stack to reach the top of the screen. So, this parameter plays an important role in the algorithm.

  • Check hold piece: (it is a piece at the top corner which can be exchanged by the current piece until it locks) best end position of the current piece is compared with that of the hold piece and the better one is used.

  • Minimize empty pillars: further optimization of the algorithm requires filling of empty pillars (since they can only be filled by line pieces, and needs to be minimized), this problem is solved by penalizing the moves which resulted in an empty pillar of three or more blocks. 

And this is how artificial intelligence-powered Tetris broke the world record (however, there is no legitimacy of the record as the whole game was programmed by the programmer himself and was not official Tetris).


Our Take on This

We feel that although it is really cool to have AI perform such tasks, it is useless and not really a directed approach to improving the general intelligence of AI by making it well-versed in gaming. A human playing Tetris might have used a multitude of skills to reach a certain level, although AI does not develop skills because of training under an infinite-sample of data for a specific task.


Bibliography:

https://nerdist.com/article/coder-tetris-ai-world-record/

https://geekologie.com/2020/07/guy-codes-own-tetris-program-and-then-cr.php

Comments

Post a Comment

Popular posts from this blog

9 Techniques to Write Your Code Efficiently

(Photo by Oskar Yildiz on Unsplash ) It’s really easy to write efficient and faster code . Efficient code, not just only improves the functionality of the code but it can also reduce the time and space complexity of the programming. Speed is one of the major factors in deciding the quality of the code , for instance, your code might be producing the required result but it takes some time to execute then it will not be considered a quality code. An alternative approach to the same problem producing faster results will be considered better. The code should be clean i.e. comprehensible and readable so that it can be reused (saving the efforts of rewriting the whole program from scratch), adding new features, and making the process of debugging more easier. In this article, I will cover some simple tips and techniques which we can easily apply to make our code more elegant and efficient. "There is always more than one method to solve the problem." How to write code efficie...

Everything You Need to Know About Google Foobar Challenge

Recently, while searching a keyword “headless chrome” on Google I got an unusual pop-up on my window, with a message: "Curious developers are known to seek interesting problems. Solve one from Google?" I was surprised to see Google sending me a challenge to solve and I accepted it immediately! Clicking on “I want to play” landed me on Google’s Foobar page. It was Google Foobar Challenge! What exactly is Google Foobar Challenge? Google Foobar challenge is a secret hiring process by the company to recruit top programmers and developers around the world. And it is known that several developers at Google are hired by this process. The challenge consists of five levels with a total of nine questions , with the level of difficulty increasing at each level. What to do after getting the challenge? After selecting “I want to play” option you land on Foobar’s website which has a Unix-like shell interface, including some standard Unix commands like help, cd, ls, cat and etcetera . ...

Cheatsheet for NumPy: Essential and Lesser-Known Functions

(Photo by  Chris Liverani  on  Unsplash ) Numpy  ( stands for — Numerical Python ) is a library available in Python programming language, supporting matrix data structures and multidimensional array objects. This the most basic scientific computing library that we need to learn, to begin our journey in the field of data science. Numpy can compute  basic mathematical calculations  to make the process of creating advanced machine learning and artificial intelligence applications easier (by using comprehensive mathematical functions available within the library). Numpy allows us to  carry out various complex mathematical calculations effortlessly  along with several top-up libraries (like matplotlib, pandas, scikit-learn, etc.) built over it. This library is a great tool for every data science professional to  handle and analyze the data efficiently . Moreover, it is much easier to perform mathematical operations with numpy arrays in comparison ...

Followers