Coder Social home page Coder Social logo

minesweeper-online-solver's Introduction

Mine Sweeper Online Solver

Minesweeper Online Solver with Selenium and Python. Solver strategy is a generalized version of this guide

How to run

  • Download a webdriver you prefer and place it in the cloned folder. In Board.py modify the driver object if you are not using Chrome and the second argument of its parameters to match the name of your preferred driver. I am using chromium that I downloaded from the link saved in Info.py as DRIVER_LINK.
  • Modify strings starting with LOG_ in Info.py if you want to customize the log of actions taken by the solver.
  • Initialize Board object to your preference in Runner. Difficulties of 1, 2, and 3 correspond to the beginner, intermediate and expert modes respectively. Booleans log and mark_flags represent whether the solver will print log in the console and mark mines with flags on the web page.
  • Stop the solver once the board is solved!

Demo

MineSweeperOnline demo

API

from Board import Board
Board(difficulty=3, log=True, mark_flags=True).play()
from Board import Board
Board().play()

Todos

  • Combining Python inheritance with mutation of the existing objects
  • Account for the relationship of number cells neighboring through the blank cell and improve probability
  • Optimize computation by storing the results
  • Selenium alert and error handling
  • More tests
  • Use Enums
  • Change design to follow Strategy pattern

Why

  • Fun
  • Competition with my girlfriend
  • Prove that I can do better with code than manually

minesweeper-online-solver's People

Contributors

h0rban avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.