Hacker News new | ask | show | jobs
by rcoh 4485 days ago
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.