An open API service indexing awesome lists of open source software.

https://github.com/theokanning/2048-python-bot

A 2048 Bot written in Python using an adversarial search algorithm. Uses screen grabbing to determine the game state and a basic tree search to calculate moves.
https://github.com/theokanning/2048-python-bot

2048 bot python tree-search

Last synced: 1 day ago
JSON representation

A 2048 Bot written in Python using an adversarial search algorithm. Uses screen grabbing to determine the game state and a basic tree search to calculate moves.

Awesome Lists containing this project

README

          

# 2048-Python-Bot
A Python bot that plays 2048. Uses screen grabbing to determine the game state and a basic tree search to calculate moves.

https://gabrielecirulli.github.io/2048/

Currently reaches 2048 a little under 50% of the time.

Screen grabbing code is taken from this excellent example, and you'll have to calculate the game coordinates to match your screen size!

http://code.tutsplus.com/tutorials/how-to-build-a-python-bot-that-can-play-web-games--active-11117

## Search
During tree search, the computer is simulated as an opponent that aims to create tiles in the worst possible location, and the bot picks the move that minimizes the risk of bad random placements.

Simple heuristics are used to reward good behaviors, such as keeping the top row full and keeping numbers in order so they can be combined easily.