Live data from Hacker News

2048 AI

ov3y.github.io

1–10 of 197 posts

Re: 2048 AI

#4

That's awesome. I'm looking at the source code but I can't seem to grasp it. What's a simple explanation of how it works?

From github: The algorithm is iterative deepening depth first alpha-beta search. The evaluation function tries to minimize the number of tiles on the grid while keeping same/similar tiles in line with each other.

This basically means he's running an optimized version of minimax -- essentially, depth first search of game states looking for states that minimize tiles and keep them in line.

At each step, he looks several steps into the future, assigns them each a numerical score, then picks the move that leads to the best outcome.

Iterative deepening means that he evaluates all 1 move options, then all two move options, then all 3 moves options and so on. It increases the chances of finding a good move within a time constraint.

Alpha beta is a "lossless" optimization that allows you to more aggressively prune the tree when you're searching.

Re: 2048 AI

#6
I tried twice and it didn't finish, after getting to 1024 both times... this shows just how difficult is that game!
Post reply on HN