Elixir Quiz

Weekly programming problems to help you learn Elixir

Tic Tac Toe part 2: The Application

Welcome to the fifteenth edition of Elixir Quiz. This week we will be continuing our multi-week Tic Tac Toe project.

Last week we built a game that could be played by a human and a computer player. This week we will be continuing that game, and making it possible for a game server to manage several games at once.

Supervision Trees

The official Erlang documentation describes supervisors as:

a process which supervises other processes called child processes. A child process can either be another supervisor or a worker process.

Supervisors are used to build an hierarchical process structure called a supervision tree, a nice way to structure a fault tolerant application.

For more information, see the OTP design principles document.

The problem

Create an OTP application that manages several games of tic-tac-toe. The games should be monitored by a supervisor, and recover if they crash for any reason.

Next week we’ll create an interface for the game so that people can connect to it and play against other people.

Like last week, a good reference on how a multiplayer game can hang together in an OTP application, check out Martin Schurrer’s talk at ElixirConf 2014.

How do I enter?

Part 2 of the Tic Tac Toe quiz runs from Saturday November 29th 2014 until Friday December 5th, 2014.

To enter, just complete the problem and post a link to the code on Twitter, and mention @elixir_quiz. As always, you can host your code anywhere (like Github Gists), or post your solution directly into the subreddit post.

Example solutions

After the quiz period ends on December 5th, I will update this section and talk about some interesting solutions that were posted on Twitter.