Coding, JavaScript, Milestones, Simon teaching, Simon's Own Code

Building a 2048 Game. Part 3.

Simon’s general plan for his 2048 project:

Link to the project in progress on GitHub: https://github.com/simon-tiger/2048

In this third part he shows how he changed the fonts, how that messed up the code, how he solved that problem and also how he created a function to move any tile anywhere else on the grid. Simon doesn’t yet have the function to move a tile to the right place – he’ll cover that in game mechanics in Part 4.

Link to Parts 1 and 2.

Coding, JavaScript, Simon makes gamez, Simon's Own Code

Simon’s own 2048

Link to the project in progress on GitHub: https://github.com/simon-tiger/2048

Simon has started building his own 2048 game. In the two videos below he explains the initial stages of the project and how he has created the tiles. At the moment, he plans to build a classic 2048 first and create a few desktop versions of more exotic variations of 2048 later.

Math Tricks, Milestones, Murderous Maths, Simon teaching, Simon's sketch book

The Math Behind 2048

Simon shares his strategy to win a 2048 game. He has also worked out a general formula of what a maximum tile can be in any grid. For a 4 x 4 grid classic 2048 grid that maximum is 2^17 or 131072!

“It’s a lovely coincidence that there are 17 particles known in the Standard Model of particle physics, and 2^17 is also the maximum value tile in 2048. And so LHC 2048 actually exists!” Simon shouted after we had finished filming. Ten minutes later, walking outside, he calculated that when playing simplest version of 2048, the game of 4 on a 2 x 2 grid, the probability of winning (getting 4) is 19% if you do nothing, 54% if you make one move and 27 % if you make two moves. He also proved that in the game of 4, you win with the maximum of two moves.

2048 offers a lot of opportunities for math fun!

Coding, Java, Milestones, Notes on everyday life, Simon makes gamez, Simon's Own Code, Together with sis

2048

We had a great Sunday visiting friends in The Netherlands whose kids resemble Simon in many ways. Simon made his signature bubble solution:

and learned about ray tracing in Java:

After I asked him that evening, what he loved most from the past weekend (that also involved sleeping over at grandparents’ house in Friesland), he said: trying to write code for 2048! I was surprised to hear that as I saw him do several projects in the course of the weekend but no “2048”. What is 2048? It turned out that, after he got tired of playing and snuggled with his laptop in the living room at our friends’ home, Simon tried to write his own code for a game he had played almost two years ago, involving the powers of 2. “It just got into my head!” he explained in the car on the way back. The video below is how far Simon got coding the game: