8 ms·
Binary Puzzle
- EvanKelly 9y agoOh Hi (https://play.google.com/store/apps/details?id=com.presto.ohhi&hl=en_GB https://play.google.com/store/apps/details?id=com.presto.ohh...) is an app I have that has these puzzles. Simple rules and can get surprisingly difficult.
- eldavojohn 9y agoWhat's the difference between your app (that has 100-500 downloads) and this app that has 100,000-500,000 downloads? https://play.google.com/store/apps/details?id=com.q42.ohhi&hl=en_GB https://play.google.com/store/apps/details?id=com.q42.ohhi&h...
- pavel_lishin 9y agoEven the description is a word-for-word copy of 0h h1.
- EvanKelly 9y agoHa, oops, my wording was bad...I meant I had it on my phone...not my app and I just searched the app store. I'll change my link. EDIT: No way to edit old posts, but the link I posted is obviously a rip-off of the Q42 app linked elsewhere.
- grumph 9y agoIt's "Unruly" in Simon Tatham's puzzle collection[1]. There is also an android version [2]. In the manual: "This puzzle type was invented by Adolfo Zanellati, under the name ‘Tohu wa Vohu’." [1] https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ [2] https://chris.boyle.name/projects/android-puzzles/ https://chris.boyle.name/projects/android-puzzles/ or https://f-droid.org/repository/browse/?fdfilter=puzzles&fdid=name.boyle.chris.sgtpuzzles https://f-droid.org/repository/browse/?fdfilter=puzzles&fdid...
- schoen 9y agoNice! For people who don't get the reference in the name Zanellati gave, https://en.wikipedia.org/wiki/Tohu_wa-bohu https://en.wikipedia.org/wiki/Tohu_wa-bohu Edit: I didn't realize that, as Wikipedia says, this Hebrew phrase is used as a loanword in several European languages to refer to disorder, which in turn explains why Tatham called it "Unruly".
- zmonx 9y agoThe declarative programming language Prolog is a natural choice for solving such combinatorial tasks. Here is a Prolog formulation of the puzzle, using constraint logic programming over integers that ships with typical Prolog systems: binary_puzzle(Rows) :- length(Rows, L), maplist(same_length(Rows), Rows), maplist(only_two_next_to_each_other, Rows), transpose(Rows, Cols), maplist(only_two_next_to_each_other, Cols), maplist(booleans_integer, Rows, RIs), all_different(RIs), maplist(booleans_integer, Cols, CIs), all_different(CIs), Half #= L // 2, maplist(equally_distributed(Half), Rows), maplist(equally_distributed(Half), Cols). equally_distributed(L, Bs) :- global_cardinality(Bs, [0-L,1-L]). booleans_integer(Bs, I) :- foldl(pow, Bs, 0-0, I-_). pow(B, N0-I0, N-I) :- B in 0..1, N #= N0 + B*2^I0, I #= I0 + 1. only_two_next_to_each_other([]). only_two_next_to_each_other([_,_]). only_two_next_to_each_other([A,B,C|Rest]) :- ( A #= B ) #==> ( C #\= B ), ( B #= C ) #==> ( B #\= A ), only_two_next_to_each_other([B,C|Rest]). For example, let us consider the concrete 10x10 puzzle of today: puzzle([[_,_,_,_,_,1,_,_,_,1], [1,_,_,_,_,_,_,0,_,_], [_,_,0,_,_,_,_,0,_,_], [_,0,0,_,_,_,0,_,_,1], [1,_,_,_,_,_,_,_,_,1], [_,_,_,0,_,_,1,_,_,_], [0,_,_,_,_,1,_,_,_,_], [_,_,_,_,_,_,_,0,_,0], [0,_,_,_,_,_,_,_,_,0], [_,0,_,0,_,1,_,_,_,_]]). You can solve it with the above formulation, using for example SICStus Prolog and its CLP(FD) library, with the following query: ?- puzzle(Rows), binary_puzzle(Rows), maplist(label, Rows), maplist(portray_clause, Rows). The unique solution is: [0, 1, 0, 1, 0, 1, 0, 1, 0, 1]. [1, 0, 1, 0, 0, 1, 1, 0, 1, 0]. [0, 1, 0, 1, 1, 0, 1, 0, 1, 0]. [1, 0, 0, 1, 1, 0, 0, 1, 0, 1]. [1, 0, 1, 0, 0, 1, 0, 0, 1, 1]. [0, 1, 1, 0, 1, 0, 1, 1, 0, 0]. [0, 1, 0, 1, 0, 1, 0, 0, 1, 1]. [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]. [0, 1, 0, 1, 1, 0, 1, 1, 0, 0]. [1, 0, 1, 0, 0, 1, 0, 1, 0, 1]. It is found within a second on current machines. The above formulation is also quite general. For example, you can use it to complete, test and generate solutions: ?- binary_puzzle(Rows), maplist(label, Rows), maplist(portray_clause, Rows). This generates valid solutions of the puzzle for all board sizes: Rows = [] ; [0, 1]. [1, 0]. Rows = [[0, 1], [1, 0]] ; [1, 0]. [0, 1]. Rows = [[1, 0], [0, 1]] ; [0, 0, 1, 1]. [0, 1, 0, 1]. [1, 0, 1, 0]. [1, 1, 0, 0]. Rows = [[0, 0, 1, 1], [0, 1, 0, 1], [1, 0, 1, 0], [1, 1, 0, 0]] ; [0, 0, 1, 1]. [0, 1, 0, 1]. [1, 1, 0, 0]. [1, 0, 1, 0]. Rows = [[0, 0, 1, 1], [0, 1, 0, 1], [1, 1, 0, 0], [1, 0, 1, 0]] ; etc. Thank you for sharing!
- rgerganov 9y agoThis is copy paste of http://0hh1.com http://0hh1.com
- mhei 9y agoOr possibly the other way round? 0hh1.com was registered in 2014 according to whois info, the puzzles on this site go back to 2011. (I'm not claiming this is proof, of course)
- rplnt 9y agoAlso, the list of puzzles on the site goes to March 2011. I think this is a nice case of taking something interesting and making it more approachable, perhaps even fun.
- kmm 9y agoThey're older than that, this kind of puzzle is called a Takuzu or Binairo and was invented in 2009 by a pair of Belgians: https://fr.wikipedia.org/wiki/Takuzu https://fr.wikipedia.org/wiki/Takuzu
- tome 9y agoI wonder how one creates puzzles like this (or indeed creates Sudoku puzzles). I can think of a few strategies 1. Lovingly hand craft them. Extremely labour intensive! 2. Generate random grids and repeatedly remove elements. If that leads to a puzzle with more than one solution, backtrack. 3. Add random elements to an empty grid. Eventually the grid will have one or zero solutions. If zero, backtrack. If one, stop. Finally, classify the difficulty using some heuristic. Does anyone have a better strategy? Is there some "analytic" property that guarantees uniqueness of solutions without resorting to some black box solver?
- tedmiston 9y agoSudoku puzzles are created both automatically and semi-automically / modified by hand to make them more elegant or enjoyable. I've bought a few sudoku puzzle books that usually discuss it like an art in the preface.
- tedmiston 9y agoOh and about designing for difficulty level — I think it's sort of reverse engineered from the fully solved state by continually removing numbers until it's more sparse / harder. I believe some of the apps do it by incubating puzzles then gathering aggregate statistics about how long it took people to solve then bucket < 5 min --> easy, 5-10 min --> medium, 10-15 --> hard, 15+ min --> evil, etc.
- fenomas 9y ago> Is there some "analytic" property that guarantees uniqueness of solutions without resorting to some black box solver? Check out Knuth's Algorithm X. It's an elegant way of analyzing constraint-satisfaction sorts of problems (of which both Sudoku and the linked puzzle are examples). https://en.wikipedia.org/wiki/Knuth%27s_Algorithm_X https://en.wikipedia.org/wiki/Knuth%27s_Algorithm_X edit: at least I think the linked puzzle is a constraint problem that could be modeled this way. But now that I consider it it's not so obvious...
- tedmiston 9y ago
- sarah2079 9y agoNooooooo! I clicked "The rules in more detail..." and it cleared my half-finished puzzle.
- pavel_lishin 9y agoYeah, I really wish it remembered your current puzzle state.
- tedmiston 9y agoAn example of the easy 6x6 puzzle instead of starting with a very hard 10x10: http://binarypuzzle.com/puzzles.php?size=6 http://binarypuzzle.com/puzzles.php?size=6
- adictator 9y agoI wish it highlighted errors. But great game nonetheless.
- alangpierce 9y agoIf anyone else was confused by the rule "No more than two similar numbers below or next to each other are allowed", I think it means that you aren't allowed to have three in a row of the same number, horizontally or vertically.
- jmull 9y agoYes, that's what I found. (I too had trouble with that instruction.)
- bsurmanski 9y agoWhy? Is this a property to guarantee there are no duplicate binary numbers, or an arbitrary rule to make the puzzle tractable?
- GrantSolar 9y agoI feel that the rules should contain some examples. I spent a while battling a puzzle to realise that I had been interpretting "No more than two similar numbers next to or below each other are allowed." as "A box must have no more than 2 neighbours of each number" i.e. Exactly 2 0s and exactly 2 1s in the non-diagonal neighbours. I think that what's being referred to is runs of numbers, so if you see 0,0,_ you know the last one must be a 1
- Avshalom 9y agoI on the other managed to completely not read the part where each row/column is split between 1s and 0s. Tatham's version helpfully yells at you when you break the rules which is how I realized I was missing an important bit of information.
- cookingrobot 9y agoI got past that and then realized every row/column needs to be unique.
- savanaly 9y agoYep, I made the exact same mistake. The hints have examples that disambiguate it which is how I found out in the end.
- panic 9y agohttp://0hh1.com http://0hh1.com is a much better place to learn the rules.
- BatFastard 9y agoIndeed it is, it explains the rule, gives you feedback, and it better looking in general.
- HiroshiSan 9y agoI find it's easier than the puzzle linked since my brain can't unsee '1' and '0' as one and zero, whereas with the blocks, they're just abstract shapes with no meaning aside from colour.
- GrantSolar 9y agoI feel that the rules should contain some examples. I spent a while battling a puzzle to realise that I had been interpretting "No more than two similar numbers next to or below each other are allowed." as "A box must have no more than 2 neighbours of each number" i.e. Exactly 2 0s and exactly 2 1s in the non-diagonal neighbours. I think that what's being referred to is runs of numbers, so if you see 0,0,_ you know the last one must be a 1
- sushimako 9y agoVery cool! It keeps saying that it's not solved correctly, but i cannot find the mistake: http://i.imgur.com/qPJLafH.png http://i.imgur.com/qPJLafH.png Already ironed out identical columns but can't seem to find anything else. Any idea?
- cerebrum 9y ago1. and 6. row identical.
- sushimako 9y ago1 & 7, thanks!
- coroxout 9y agoI also have a filled-in square which it says is incorrect with no indication of where/why it's incorrect, which is quite frustrating. Would it really be too easy if you could guess and then be told why it was inconsistent?
- ralfd 9y agoI am stuck. What is the next step here? (Aside from programming it in Prolog.) https://i.imgur.com/ezUHHBp.png https://i.imgur.com/ezUHHBp.png
- kevlened 9y agoLook at row 3 (0,1,0, , , , ,0,1,0)
- aqme28 9y agoThat's exactly where i got stuck too
- savanaly 9y agoLook for columns and rows where you have four of the five of 0's or 1's. Knowing there can be only one more of that type in the remaining empty spots usually yields something unless it's down to two empty spots.
- Jtsummers 9y agoLast year my desk calendar had a bunch of these sorts of puzzles, so some things I learned: Any time you see "0..1" you have to have a 0 and 1 between them. This is useful since each row/column must have the same number of 0s and 1s (5 each in your puzzle). So counting from (1,1) as the top left, what does (6,3) have to be? You may not know the position of all the 0s and 1s in row 6, but you have most of them accounted for because of this specific relationship, and one free space. Figure it out and you get at least 5 positions resolved. Keeping in mind that the number of 0s and 1s have to be the same, find rows where the number of 0s or 1s is near the max but the other is far from it. Your row 3 is one such location. There has to be one more 0 and three more 1s. Since the 1s can't all be together, you get some constraints on the outside of that four space gap "010...010". If you put the 0 on the outside of the gap, the 1s must be all in a row which is invalid. Your column 2 offers a similar situation. 4x0s and 2x1s. (from the top) ".01001...0". Where can the one remaining 0 go, or where can't it go? Repeating this I can spot about 15-20 spaces that'll be filled in very quickly, and the rest probably falls into place after that.
- eridius 9y agoIf you like puzzles like this, you should check out Nikoli (http://www.nikoli.com/en/ http://www.nikoli.com/en/). They're a Japanese gaming company with a bunch of puzzles online. They don't have this particular puzzle, but they have similar ones, like Hitori (http://www.nikoli.com/en/puzzles/hitori/ http://www.nikoli.com/en/puzzles/hitori/).
- scscsc 9y agoI have implemented a while ago an Android version (https://play.google.com/store/apps/details?hl=en-gb&id=com.ovaludi.nothree.android https://play.google.com/store/apps/details?hl=en-gb&id=com.o...). By far, the most interesting part is automatically generating the levels by difficulty. In my implementation, I first generate a full puzzle and then start removing pieces one by one, as long as the part just removed can be logically deduced. The only difference between easy/medium/hard is the amount of work performed in the logical deduction: one step for easy, two steps for medium and three for hard.
- deleted 9y ago[deleted]
- Aardwolf 9y agoIt's actually a little bit like doing deductions in minesweeper... without the random probabilities and timer