# 2048

nivå
5+
Once upon a time there lived a young Italian named Gabriele Cirulli. He was a student of programming. One day, while doing a coding exercise, he made a breakthrough in the gaming industry entirely by accident. How did he manage to do that? To complete the exercise, he chose to write a game with something similar to an existing puzzle game called "Threes". Gabriele, who named the game "2048", spent two days on its implementation. The game was free and staggeringly successful! Even if you haven't played 2048 yourself, your friends and acquaintances most likely have. Or you've seen people playing it on public transport. Remember those colorful numbered tiles that filled smartphone screens several years back? That's 2048! The game's name isn't random. 2048 is 2 raised to the 11th power. In the game, everything is based on powers of two. The rules are short and sweet: you have a 4x4 board divided into square tiles. A tile with a value of 2 (probability of 90%) or 4 (probability of 10%) appears in each round. All the tiles can be moved to one of the four sides. If two tiles with the same value "collide", they merge and the tile value doubles. The objective is to get a tile whose value is 2048. The player loses if another move is no longer possible. What's so special about the game? First of all, it's very easy to play in a browser or on a smartphone. Let's create our own version of the game right on CodeGym. Who knows? Maybe after doing this you will also accidentally invent your own wildly successful puzzle game? Carry on!
Kommentarer (40)
Du måste vara inloggad för att lämna en kommentar
3 March, 09:37
``````

``````
3 March, 09:36
``````

``````
3 March, 09:35
vous parler tous englais ou coi
Anonymous #11388504
Nivå , ,NiNi
8 September 2023, 01:32
Part 17 says "I think you long ago noticed the line at the bottom of the game board: "Score: 0"." However there is no score displayed even after I implement the changes.
Anonymous #11138917
Nivå , ,NiNi
8 September 2023, 10:04
I use ↑↓→, the reaction is different
Anonymous #11388504
Nivå , ,NiNi
7 September 2023, 14:47
Part 3 says "A void createGame() method..." with no indication that it needs to be private.
Anonymous #11138917
Nivå , ,NiNi
4 September 2023, 09:13
I attempted to run the code, and when I used the "moveUp()" function, the outcomes didn't match my expectations. Consequently, I made some adjustments to my code in an attempt to address the issue correctly. However, even after applying the provided example to solve the problem, the results still didn't align with what I had anticipated. Furthermore, I noticed that the changes made to the two-dimensional array after calling "moveUp" didn't follow the "rotateClockwise()" method as expected, which left me feeling somewhat puzzled. Regrettably, due to space constraints, I'm unable to share my code here. If it's possible, could you please reach out to me via email? I would greatly appreciate any guidance or assistance you can provide. My email address is: moryforcola@outlook.com Thank you very much for your help.
WuYtao
Nivå , ,Ni
22 August 2023, 17:45

Cute Killer
Nivå , ,NiNi
19 April 2022, 17:09

20 April 2022, 10:51

leonjusinov0070
Nivå , ,NiNi
26 February 2022, 12:55
Hallo
Lê Thanh Bình
Nivå , ,Ni
15 August 2021, 07:13
bủh