2048

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

2048

Post by Bender »

Hi,
I wonder if you guys have seen this little game: http://gabrielecirulli.github.io/2048/
It's quite popular nowadays.

The main focus of the game is to get to the 2048 tile. It involves moving the entire 4x4 tileset left, right, up or down. Each tile in the tileset holds a number which is a power of 2. Say we have: (E stands for empty square)

Code: Select all

2 4 2 8
E 2 2 E
8 2 4 E
E E E E 
Now you've got 4 options as previously mentioned, up, left, right, down. Note that when you will push two similar numbers together on the same side they join together and sum up and a random tile (2 or 4) will spawn.
So if I move the tileset up,

Code: Select all

2 4 4 8
8 4 4 E
E 2 E E
E E E 2 --> Random tile
The maximum I could get was 1024, with a score of 11188.
Have fun. :)
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: 2048

Post by Combuster »

Turns out there's a decent strategy for this game - managed to hit the 2048 twice in the last four games. (no spoilers on how to do that one yet :wink:)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: 2048

Post by Love4Boobies »

I didn't try putting my combinatorics hat on but I did play the game several times and won the last few, even managing a 4096 piece twice in a row. I won't go into tactics here (there are a few useful tricks, I've found) but my general startegy was to try to have the blocks in increasing order and always work on the smallest. Whenever forced to screw up the order (say, 256, 512, 256), I would work on the out-of-order block, to eventually unite it with its smallest neighbour. I would pretty much never go in one direction (say, up) and if I was forced to, I would then try to clean up the mess. The nice thing about this strategy is the "cascade" effect you get every now and then, when one merger leads to another.

There are probably better ways but this seemed simple and effective.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: 2048

Post by Love4Boobies »

I am happy to report that this technique is good up to at least 8192. :)

On a related note, I also came across Evil 2048, which creates blocks in unfortunate places (managed to score 1024 after a few games), and 2048 - 3D, that I only played once and sucked at but will try again at some point (someone suggested it gets easier than the regular 2048 once you get used to it).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
ChosenOreo
Member
Member
Posts: 25
Joined: Sun May 29, 2011 5:16 pm
Location: Inside A Computer
Contact:

Re: 2048

Post by ChosenOreo »

Damn.. I am terrible at that game :lol:
Best I got was 1024 :(
kutkloon7
Member
Member
Posts: 98
Joined: Fri Jan 04, 2013 6:56 pm

Re: 2048

Post by kutkloon7 »

Damn, it's so hard! I always get a nice pattern that increases, with the highest in a corner, until one lower block gets there, then it all goes to hell :P
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: 2048

Post by onlyonemac »

I tried this recently - I particularly like the Android app version because I can play it on my phone but it is rather difficult once and the furthest that I got was 1024. How come is everyone going beyond 2048? Does the game not automatically end when you get to 2048?

Anyway I'm open to suggestions and hits and tips because I'm really battling with this game! (Although I have got some quite good scores a few times though, although not often though...)
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Post Reply