News for hackers. Stuff that matters.
Re:2048 Solver by loisaidasam on Wednesday March 26, 2014 @12:33PM (#7474539)
I forked the main 2048 repo and modified it so that you can write your own "brain" for it:

https://github.com/loisaidasam/2048

Essentially it communicates via an API to a webserver where you write your "brain" logic and respond to the API requests with which move to choose next:

https://github.com/loisaidasam/2048/blob/master/js/autonomou...

Since it's over web, you can write your webserver in the language of your choosing. I wrote a small dumb Python webserver using the Flask microframework:

https://github.com/loisaidasam/2048/blob/master/py/webserver...

And it simply returns a random direction:

https://github.com/loisaidasam/2048/blob/master/py/game.py

This can be adapted obviously for whatever logic you choose. The reason I forked this version and not a totally server-side one (which would be better for performance obviously) is that you can actually watch the moves this one makes as it chooses them, which makes it kinda fun.

Enjoy!

Re:2048 Solver by elwell on Wednesday March 26, 2014 @01:50PM (#7475044)
This is the most efficient version I was able to get: https://news.ycombinator.com/item?id=7475031