Code Monkey home page Code Monkey logo

8-puzzle-python-bot's Introduction

8-puzzle-Python-bot

This is a Python bot that solves the 8 puzzle problem using the A* algorithm. Specifically, it is designed to solve puzzles generated by the puzzle game of the mypuzzle.org website.

Before we start coding the bot, we must first get a screenshot of the game area. Once we get it, we convert it to black and white so that our bot will have a much smaller range of colors to compare between image tiles. Finally, we crop each tile representing a number of the puzzle and store it. That will help us in making comparisons among image tiles and creating a 2D array representing our problem.

After using the A* algorithm and finding a solution for our problem, we use automated mouse clicks to swap tiles in puzzle and achieve our final state.

The bot was created using version 3.4.2 of Python.

The specific Python bot uses:

  1. The Python Imaging Library (PIL) for screenshots, color conversions and image comparisons.
  2. The pyautogui module in order to simulate mouse clicks.

8-puzzle-python-bot's People

Contributors

vasilisg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.