Welcome to the seventeenth edition of Elixir Quiz. This week we will be creating our own version of the game, 2048.
The 2048 Game
The game is played on a 4x4 grid, which is initially empty except for 2 randomly selected tiles, which have either a 2 or a 4 value in it. Players play the game by pushing all of the tiles in a specified direction; up, down, left or right.
When tiles with matching values come into contact, they merge into one (the one furthest in the direction that was specified). The value of this new tile is the combined value of the tiles. After each turn, a new tile (either a 2 or a 4) is generated in one of the free spaces.
The player wins by creating a tile with the value 2048, and loses if the board is filled with tiles and no more moves are available.
Create the game of 2048. You can simply use the command line for output, or build a web application if you’re feeling ambitious.
How do I enter?
The 2048 quiz runs from Saturday December 13th 2014 until Friday December 19th, 2014.
After the quiz period ends on December 19th, I will update this section and talk about some interesting solutions that were posted on Twitter.