### Alexandre Muñiz

Shared publicly -As I mentioned before, I am going to be getting some custom laser-engraved dice made, and I have been looking for nice mathy design ideas. One promising idea was the magic cube found by Mirko Dobnik, and shown at http://www.magic-squares.net/c-t-htm/c_unusual.htm#order%202

This cube has faces divided into 2×2 grids, where each face sums to 50, and each ring around the cube sums to 100. In order to turn Dobnik's cube into a usable d6, I would need to find a solution that placed the numbers 1 to 6 on different faces of the cube.

I decided this was a good time to learn how to use a constraint solver. I picked Numberjack because it uses Python, which is the language I am most comfortable with, and there was a magic square example that I could tweak. With face sum and ring sum constraints, and constraints to put the numbers 1 to 6 on the proper faces, (plus symmetry breaking constraints) I was getting at least hundreds of thousands of solutions. So I added constraints for the four diagonals that traverse all six faces to sum to 75, and I fixed the numbers 1 to 6 in the positions I liked best. That gave just eight solutions. Of those eight, the one shown had odds and evens in checkered positions on all six faces. (Note that I did not use the 'zig-zag' line constraints that Dobnik's solution satisfies.)

This cube has faces divided into 2×2 grids, where each face sums to 50, and each ring around the cube sums to 100. In order to turn Dobnik's cube into a usable d6, I would need to find a solution that placed the numbers 1 to 6 on different faces of the cube.

I decided this was a good time to learn how to use a constraint solver. I picked Numberjack because it uses Python, which is the language I am most comfortable with, and there was a magic square example that I could tweak. With face sum and ring sum constraints, and constraints to put the numbers 1 to 6 on the proper faces, (plus symmetry breaking constraints) I was getting at least hundreds of thousands of solutions. So I added constraints for the four diagonals that traverse all six faces to sum to 75, and I fixed the numbers 1 to 6 in the positions I liked best. That gave just eight solutions. Of those eight, the one shown had odds and evens in checkered positions on all six faces. (Note that I did not use the 'zig-zag' line constraints that Dobnik's solution satisfies.)

1

Add a comment...