Playing Tetris with Genetic Algorithms
Genetic Algorithms in Elixir — by Sean Moriarity (78 / 101)
👈 Visualizing Basic Statistics | TOC | Installing and Compiling ALEx 👉
The Arcade Learning Environment (ALE) is a framework designed to allow programmers to easily develop AI agents for Atari 2600 games. The ALE was originally written in C++ with interfaces to Python, Java, and other languages. The ALE supports numerous Atari ROMs, including popular titles like Tetris, Space Invaders, and Pac-Man.
ALEx stands for Arcade Learning Environment in Elixir. ALEx uses NIFs to create an Elixir wrapper around the ALE to allow Elixir programmers to develop agents for the ALE. ALEx offers all of the same functionality as the ALE, conveniently packaged in an Elixir library.
In this section, you’ll use ALEx to evolve agents to play Tetris. The agents you design in this chapter will be naive — the purpose is simply to see how genetic algorithms can integrate with visual tools to produce real results.
👈 Visualizing Basic Statistics | TOC | Installing and Compiling ALEx 👉
Genetic Algorithms in Elixir by Sean Moriarity can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

