TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Cracking Minesweeper with Z3 SMT Solver

177 点作者 iou大约 8 年前

7 条评论

dino463大约 8 年前
I wrote a language some time ago exploring the use of SAT solvers for these types of problems, trying to make writing solvers easy to reason about, never quite took off, but here&#x27;s what the minesweeper solution looked like: <a href="http:&#x2F;&#x2F;sabrlang.org&#x2F;mine&#x2F;" rel="nofollow">http:&#x2F;&#x2F;sabrlang.org&#x2F;mine&#x2F;</a>.<p>It basically translates the somewhat more complex rules into the simpler SAT rules using minisat. However sometimes needed a generator in python to make the rules :&#x2F;. But still kinda nice to see it more visually, language looks like this in the end: <a href="http:&#x2F;&#x2F;sabrlang.org&#x2F;code&#x2F;mine&#x2F;source.txt" rel="nofollow">http:&#x2F;&#x2F;sabrlang.org&#x2F;code&#x2F;mine&#x2F;source.txt</a>. It basically lists the requirements for middle, edge and corner blocks, than says where those blocks are on the &quot;board.&quot;<p>Kinda fun, though arguably somewhat restrictive. One of the more fun ones I think is the rubiks cube: <a href="http:&#x2F;&#x2F;sabrlang.org&#x2F;rubik&#x2F;" rel="nofollow">http:&#x2F;&#x2F;sabrlang.org&#x2F;rubik&#x2F;</a>.
评论 #13800510 未加载
评论 #13800690 未加载
ronilan大约 8 年前
Here we go again. Someone says &quot;minesweeper&quot;. I shamelessly plug my js implementation: <a href="http:&#x2F;&#x2F;www.ronilan.com&#x2F;bugsweeper&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.ronilan.com&#x2F;bugsweeper&#x2F;</a> Don&#x27;t ask me why.<p>P.S - it&#x27;s with bugs instead of mines just because fontawesome didn&#x27;t have mines. No puns intended.
评论 #13798957 未加载
评论 #13799871 未加载
评论 #13799387 未加载
评论 #13798730 未加载
评论 #13801016 未加载
评论 #13798724 未加载
评论 #13798838 未加载
评论 #13798949 未加载
评论 #13798649 未加载
评论 #13799649 未加载
iaw大约 8 年前
This makes me wonder:<p>Is there a strategy such that it can consistently solve every minesweeper configuration?<p>I always assumed that the 50&#x2F;50 guess was unavoidable on some maps but I don&#x27;t know if that&#x27;s true.
评论 #13797920 未加载
评论 #13799975 未加载
评论 #13797959 未加载
评论 #13798118 未加载
评论 #13797851 未加载
评论 #13797839 未加载
评论 #13798121 未加载
评论 #13798938 未加载
luckyt大约 8 年前
I wrote a Minesweeper solver a while ago, it uses backtracking search with decent results: <a href="https:&#x2F;&#x2F;luckytoilet.wordpress.com&#x2F;2012&#x2F;12&#x2F;23&#x2F;2125&#x2F;" rel="nofollow">https:&#x2F;&#x2F;luckytoilet.wordpress.com&#x2F;2012&#x2F;12&#x2F;23&#x2F;2125&#x2F;</a><p>Now I wonder how does the performance of this SAT solver compare to backtracking? Which one deals better with situations where guessing is required?
评论 #13798578 未加载
partycoder大约 8 年前
The thing is that in minesweeper you cannot win in a deterministic way. Sometimes you will lose in your first move.
评论 #13801432 未加载
doublec大约 8 年前
There&#x27;s an implementation of a Minesweeper solver in Mozart&#x2F;Oz too &quot;Playing the Minesweeper with Constraints&quot;: <a href="https:&#x2F;&#x2F;www.info.ucl.ac.be&#x2F;~pvr&#x2F;minesweeper.pdf" rel="nofollow">https:&#x2F;&#x2F;www.info.ucl.ac.be&#x2F;~pvr&#x2F;minesweeper.pdf</a>
kebman大约 8 年前
Great project! Made me remember making a Fallout 2 Computer Console cracker in Perl. Great fun!
评论 #13807372 未加载