AI Challenge: '2048'

Found this extremely addicting puzzle.

Anyone want to have a go at creating a solver?

Bonus points if the algorithm is able to be performed by a human.

Source code, if needed

fun little game, I got all the was to a score of 6932, with a 512 block and a 256 block on the board. :stuck_out_tongue:

Was well on my way to a 1024 block but everything fell apart on me. :frowning:

Yeah its an awesome game concept, I love it. Could not get very high, though.

“This Precious Land” is a similar concept which was more enjoyable to play
http://ishisoft.com/archives/884

I’m finding it very hard to even understand how to solve the puzzle, let alone program something to do it for me.

There seems to be a somewhat random element in that after every move, a random block is chosen (of all blocks, including those with 2’s already and excluding those with 4 and above), then a 2 is placed there.
Sometimes this will make it look like a 4 was spawned.

Currently, my bot would spam WASDWASDWASDWASD. I have gotten over 5000 points with that method, though sometimes its as low as 2000.

I don’t need a bot, I can just mash WASD and the Arrow Keys to get a score of 3000 8)

Seems like a hackers’ version of QWOP ;D
But the game seems really interesting. I may give the AI a try here in a few.

  • Jev

Great little game.

Cas :slight_smile:

Looks like some guy already solved it on Hacker News http://ov3y.github.io/2048-AI/

@Agro: It got 1024 for me…

I only managed to get 1480 without a bot :confused: Oh well!

mmm how do you get such tile? I mean, only multiples of 2 are possible…

No, I meant as a score! My highest tile value was 128… :frowning:

Well, a ‘pure’ AI is not possible anyways. You need to have luck, since the game is not deterministic.
(remember, the new tiles are placed randomly, therefore you can’t know what happens next)

this looks like a pretty fun ML problem though

ow… I got only 512 and things started to go down hill :smiley: Still got a long way to go.

If you play carefully, and only ever use three directions (eg: never press up) you can get to 1024 without much trouble. It might even work up to 2048, but I accidentally pressed up while trying and things exploded.

I don’t think the AI needs to determine where the tile will be placed in order to get the best result. The game is for the most part quite forgiving.

High score: 15672, one 1024 tile + one 512 tile adjecent + one 128 tile near. :emo:

You actually need all 4 directions, just be careful, and lucky.

The three directions method is quite effective, but sometimes you get stuck and need to use the fourth.

http://puu.sh/7teBJ.png

I would spam LEFT + DOWN and A + S at the same time for a few seconds, then I would spam RIGHT + DOWN and D + S at the same time for a few seconds.

It sort of worked? :-\

  • Jev
  1. Can’t seem to get any further.

Had a 1024, a 512, a 256, and a 128.

Trying to think of algorithms to solve it…