Giter Club home page Giter Club logo

minesweeper-helper's Introduction

Mac扫雷程序外挂

截图

算法原理

其实最通用的算法就是,枚举所有的未知的格子得到排列组合,如果一个格子在所有合法的情况下都是雷(或者不是雷),那么可以断定一个格子一定是雷(或者不是雷).

但是这个算法的时间复杂度是 O(2^N), 不过可以进行优化. 比如: 对于不在任何已知格子旁边的未知格子, 因为并没有任何参照可以判定它是否是雷, 所以不必要参加搜索.

总之核心就是减少每次参与搜索的候选格子列表, 我采用的是每次搜索某个已知格子周围的所有未知格子, 得到所有的排列组合.

另外如果遇到无法判断的情况, 则选取概率(局部概率)最小的一个格子点击.

截图

采用 pyobjc

点击采用

采用pymouse (初始化非常慢)

minesweeper-helper's People

Contributors

dingyaguang117 avatar

Watchers

James Cloos avatar iwantaPython 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.