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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Solving domino fit using constraint programming

59 点作者 polivier大约 1 年前

9 条评论

rjeli大约 1 年前
Nice! I rewrote it in z3 and was able to avoid the if-elses by tracking the occupancy of each cell as an integer, and constraining it to exactly 1: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;rjeli&#x2F;a1612da0e3c8b99ec4514e689ebdfa85" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;rjeli&#x2F;a1612da0e3c8b99ec4514e689ebdfa...</a>
评论 #39868932 未加载
uxamanda大约 1 年前
Off topic from the solver, which is neat to read through - I’m still a big fan of this game. Looks like I’ve played 33 days of the past ~40 days. My only critique is that the UI design of the end state could be improved. Lots of very small fonts.
from-nibly大约 1 年前
Constraint programming is awesome. I learned prolog in college which can accomplish similar stuff. One of thw things thats cool is you are badically just describing the problem and the rules. As soon as you are done with that the problem is already solved.
bronco21016大约 1 年前
I love seeing this worked through step by step. Does anyone know of other blog posts where constraint programming is applied step by step to a problem?
评论 #39868915 未加载
评论 #39869534 未加载
评论 #39869351 未加载
evrimoztamur大约 1 年前
I have a hunch that we&#x27;re going to see this on next year&#x27;s Advent of Code...
ulchar大约 1 年前
I know these are the times of big machine learning models, but my favourite kind of AI are the classics like CSAT solvers, minimax with alpha beta pruning, markov chains, and good old search trees. These algorithms have superhuman powers solving so many challenging games and problems just by converting the problem space into a search tree. Love it.
akoboldfrying大约 1 年前
Nice, I haven&#x27;t come across this library before.<p>One minor suggestion: You could remove all of the corner and border special cases for overlap testing by making the grid 2 columns wider and 2 rows taller, offsetting all coordinates by 1, and pretending that the outer &quot;border&quot; on all sides of this slightly larger grid is covered with black cells.
tombert大约 1 年前
It&#x27;s definitely not optimal, but I love doing this stuff with TLA+. You define rules for state transitions, and constraints that cannot happen, and then you run a model check.<p>There&#x27;s probably better ways of doing it, but I already know TLA+ and TLC does a breadth-first search so it&#x27;ll find the shortest path.
polivier大约 1 年前
This is a solver for the game Domino Fit that was talked about on HN last month: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39420966">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=39420966</a>