Jump to content

2048 Algorithm


Recommended Posts

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.

Link to comment
Share on other sites

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:




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
Link to comment
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

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.