Jump to content

2048 Algorithm

Featured Replies

This seems like a genuinely stupid idea to me, but I can't help but pose the question: could an algorithm be written to beat the game 2048?

Remember, computer science is definitely not my area of expertise, so try not to be too hard on the n00b.

Never heard about such game.

But after playing on-line it appears it's randomizing column,row where new 2 is appearing.

Algorithm can't predict where will appear new number.

Yes, it can, it would find the most 'optimal' direction to move in. See: http://ov3y.github.io/2048-AI/.

 

Edit: To clarify, the game and all in the page linked is written entirely in Javascript/HTML, and so you can view the source / inspect element to find any included source files. I've taken out the one that contains the AI code for convenience:

http://ov3y.github.io/2048-AI/js/ai.js

 

 

Never heard about such game.

But after playing on-line it appears it's randomizing column,row where new 2 is appearing.

Algorithm can't predict where will appear new number.

 

An algorithm can't predict anymore accurately where a player will move his chess piece, but chess-playing (and winning) algorithms exist.

Edited by Sato

  • Author

Ok... If such an algorithm is possible, then what does it consist of? How do we make it work?

I win without computer algorithm.. :)

 

post-100882-0-59022200-1412895397_thumb.png

 

Oh, no... you can continue playing.. Now I will be playing forever...

Edited by Sensei

Oh, no... you can continue playing.. Now I will be playing forever...

 

No you won't. It is upper limited at less than 2^16.

Edited by fiveworlds

  • 4 weeks later...
  • 7 months later...
  • 1 month later...

yeah it should be possible. I've found keeping the larger numbers at the bottom, with the largest in a corner makes it a lot easier.

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.