Show HN: Domino Fit – Domino Tiling Puzzle
41–50 of 76 posts
Re: Show HN: Domino Fit – Domino Tiling Puzzle
#42Inspired me to build a clone to learn Svelte. I'll try that this week.
Re: Show HN: Domino Fit – Domino Tiling Puzzle
#43Re: Show HN: Domino Fit – Domino Tiling Puzzle
#44Super cool! Maybe a bigger board would be cool too :D Would also love to hear about how you designed the algorithm for generating puzzles!
Absolutely yes-
Funny story, originally it was generating 10kish tilings for a 6x6 board with 2 stones. but when I moved one of the stones over we would get... 0. WHAT? Apparently there is an entire field about dominoes (of course) and I had stumbled into something called the "Mutilated Chessboard Problem". It's impossible to tile a chessboard that has the top left and bottom right square removed. 62 open squares, doesn't matter, it's untilable. Crazy. Many boards are like this.
There is actually a very neat proof as to why, too. Placing a domino tile removes 1 black and 1 white square. So if you have e.g. 10 black and 12 white squares you're done for, you will always end up with the 0 black squares and 2 white squares remaining. With this intuition I was able to speed up the generator by skipping these types of boards.
As for it's implementation, it is a bit brute force, it recurses over a 64 bit bitboard to find all the possible domino tilings for a particular board, using bitwise operators for moves. I then use the 01 02 domino values and group them by the row/column numbers, so I can eliminate multiple solutions (less fun imo). There are definitely trillions of tilings, so after calculating all of them for a particular board and shuffling them only the first N are stored and then saved to a sqlite database.
Re: Show HN: Domino Fit – Domino Tiling Puzzle
#45Sometimes my mind wanders until I decide I want a "01" and I tap on the "01" tile at the bottom to select it. If the "01" is alredy selected, it switchs to the "02". But I tapped the "01" to select the "01" in spite it's already selected! (I have the same problem with the "02".) My recomendation is to change the logic of the selection at the bottom. Instead of switching each time, I'd like that if I tap on the left b…
Re: Show HN: Domino Fit – Domino Tiling Puzzle
#46Ar first I didn’t understand that you couldn’t rotate. Would love to have “R” reset the board.
Re: Show HN: Domino Fit – Domino Tiling Puzzle
#47Re: Show HN: Domino Fit – Domino Tiling Puzzle
#48Re: Show HN: Domino Fit – Domino Tiling Puzzle
#49Re: Show HN: Domino Fit – Domino Tiling Puzzle
#50Sometimes my mind wanders until I decide I want a "01" and I tap on the "01" tile at the bottom to select it. If the "01" is alredy selected, it switchs to the "02". But I tapped the "01" to select the "01" in spite it's already selected! (I have the same problem with the "02".) My recomendation is to change the logic of the selection at the bottom. Instead of switching each time, I'd like that if I tap on the left b…
I will try to fix this, sounds frustrating. Most likely I will change the default to what yall suggest and keep the way it works now as a settings option just for me because my muscle memory can't handle the change ha.