2048

建議等級等級
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!
留言 (40)
  • 受歡迎
你必須登入才能留言
Anonymous #11482420
等級 0 ,France
3 三月, 09:37



Anonymous #11482420
等級 0 ,France
3 三月, 09:36


Anonymous #11482420
等級 0 ,France
3 三月, 09:35
vous parler tous englais ou coi
Anonymous #11388504
等級 2 ,Granbury,United States
8 九月 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
等級 2 ,China,China
8 九月 2023, 10:04
I use ↑↓→, the reaction is different
Anonymous #11388504
等級 2 ,Granbury,United States
7 九月 2023, 14:47
Part 3 says "A void createGame() method..." with no indication that it needs to be private.
Anonymous #11138917
等級 2 ,China,China
4 九月 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
等級 0 ,United States
22 八月 2023, 17:45
没有初始代码吗
Cute Killer
等級 13 ,浙江,中国
19 四月 2022, 17:09
为什么游戏无法在idea上运行
John Squirrels CodeGym 的 Website Admin
20 四月 2022, 10:51
你遇到什么问题?请你把显示错误的截图发给我。
leonjusinov0070
等級 1 ,Germany,Germany
26 二月 2022, 12:55
Hallo
Lê Thanh Bình
等級 0 ,Viet Nam
15 八月 2021, 07:13
bủh