# Binary logic puzzle

I first came across binary puzzles in early after finding a book of them in a Belgian supermarket, not long after I first came across Haskell. And I believe that I've now published the first solver for binary puzzles written in Haskell. And it only took 3 years. The puzzles are a little like sudoku. You get a grid which contains a number of ones and zeros and you fill it in with more ones and zeros, until each row and column of the grid.

I thought so and started to write some Haskell code that would solve the puzzles. And then I got stuck. I could solve the most trivial puzzles quickly, but the iterative approach I had implemented was far too inefficient to solve the more complex ones. All I had been doing was generating the rows that could fit and then filtering the Cartesian product of them for valid grids. That worked on 8x8 grids, but beyond that things became too slow. Fast forward to A couple of days before New Year to be precise.

I found the book of puzzles and dug out my era code. I very quickly realized that I could reduce the problem space significantly simply by applying the simple deterministic rules that you use when solving the puzzles by hand. This got me to being able to solve my test puzzle from the book with my original Cartesian product approach. However, I now had a test case from binarypuzzle. I would have to check around different grids for validity.

Generating the grids was fast but checking was slow. Given a grid, you first apply the simple rules above. Then you generate a "matrix", which is a list in which each element is the rows that could possibly be answers for that grid. If there is only one entry per element, then you have a candidate correct answer. Otherwise take the shortest element with more than one entry and create matrices for each entry, filter for matrices that are filled with single entry elements and generate valid grids and return the first of those.

Once you have that the problem is solved. I believe that further improvements are possible — parallelizing to take advantage of multicore architectures or implementing more complex rules for example — and will perhaps work on them "at some point".

For now though, my Binary Puzzle solver code is on GitHub and I welcome feedback, criticism or contributions. I do log everything you type into the form. And it only took 3 years ;- The puzzles are a little like sudoku. You get a grid which contains a number of ones and zeros and you fill it in with more ones and zeros, until each row and column of the grid Has no blank spaces Is unique Contains an equal number of ones and zeros Does not contain a run of more than two ones or zeros Easy right?

You may want to read the comment guidelines before posting. You can use Markdown syntax to format your comments. You can only use level 5 and 6 headings.

I hope you managed to solve it and had a lot of fun trying to do so. I really love solving this binary puzzle. I hope you have as much fun trying to solve it as I did. How binary logic puzzle play Binary Puzzles: The goal of a binary puzzle is to fill in the grid with the numbers 0 and 1 according to the following rules: Binary Puzzles are really fun brain games.

This logic puzzle will give your brain a great exercise. Looking for free printable Binary Puzzles? You have come to the right **binary logic puzzle.** Each week I post a new free binary puzzle that you can print and solve. Hooked on Binary Puzzles? Today I have another binary puzzle for you. Lots of fun trying to solve it. Books you might like. Binary Puzzles 14x14 - Easy - Volume 8 - Puzzles.

Binary Puzzles 14x14 - Medium - Volume 9 - Puzzles. Binary Puzzles 14x14 - Hard - Volume 10 - Puzzles. Futoshiki 9x9 - Hard binary logic puzzle Volume 10 - Puzzles.

Tridoku - Easy - Volume 2 - Puzzles. Daily Kakuro Puzzle Calendar Hoshi Sudoku - Easy - Volume 2 - Puzzles. Cookies help us deliver our services. By using our services, you agree to our use of binary logic puzzle.