2048

Recommended levellevel
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!
Comments (38)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Cute Killer
Level 13 , 浙江, 中国
19 April, 17:09
为什么游戏无法在idea上运行
John Squirrels Website Admin at CodeGym
20 April, 10:51
你遇到什么问题?请你把显示错误的截图发给我。
leonjusinov0070
Level 1 , Germany, Germany
26 February, 12:55
Hallo
piers
Level 1 , United States
25 December 2021, 22:20
oh hi!
Strawberri
Level 1 , United States
24 November 2021, 20:29
Hi!
Pikachu
Level 1 , China, China
19 November 2021, 01:36
ai
Nadia
Level 0 , Poland
27 September 2021, 09:24
hej
Lê Thanh Bình
Level 0 , Viet Nam
15 August 2021, 07:13
bủh
kevin
Level 0
30 June 2021, 02:09
buh
cheyenne
Level 0
17 June 2021, 21:59
hi
TaoLu
Level 20 , 泾县, China
13 March 2021, 15:24
I'm still unable to publish it...
TaoLu
Level 20 , 泾县, China
13 March 2021, 15:45
publish result is unknow!
Alex Vypirailenko
Level 41 , USA
14 March 2021, 13:22
Please submit a question in the Help section and include your code. You can then send the link to your question to Support via support@codegym.cc
TaoLu
Level 20 , 泾县, China
14 March 2021, 15:00
Thank you i just comment this code on line 4 and it work
//import javafx.application.*;