ciphergoth: (Default)
[personal profile] ciphergoth
I had a lovely Christmas with [livejournal.com profile] spikeylady, [livejournal.com profile] some_fox, [livejournal.com profile] buttonmeup, [livejournal.com profile] yerbury and family.

I got given a "Tantrix" puzzle for Christmas as a stocking present. It contains 10 hexagonal tiles; you have to lay the tiles out to create a loop of one colour such that all the edges match up.

Actually solving the puzzles quickly lost my interest, so instead I wrote a program to solve them. Then I got interested in making a nice display of the results. I've now found all 2706 solutions to the 12 puzzles that form part of the set.



For those interested, the solver is in Python, and uses Cairo for drawing.

Date: 2006-12-28 07:49 pm (UTC)

Date: 2006-12-28 11:23 pm (UTC)
henry_the_cow: (Default)
From: [personal profile] henry_the_cow
Is the body of __sub__ supposed to contain + signs? If not, I presume this doesn't affect the result, on the "it seems to work" principle.

We got one of these puzzles last year and I had great fun solving it, by hand. Maybe I should learn Python (not that I have any time to code these days).


Date: 2006-12-29 02:22 am (UTC)
From: [identity profile] ciphergoth.livejournal.com
eek!

It's likely that it hasn't found all the possible solutions then, since that bug will break the distance-based cutoff critereon.

Thanks for spotting it!

Date: 2006-12-29 10:17 pm (UTC)
henry_the_cow: (Default)
From: [personal profile] henry_the_cow
You know, this notion of open-source review just *might* catch on...

Date: 2006-12-30 10:51 am (UTC)
From: [identity profile] ciphergoth.livejournal.com
fixed version (with many other things fixed too - eg transformations make the drawing code much simpler). Let me know if you spot anything else - thanks!

Date: 2006-12-29 11:47 am (UTC)
From: [identity profile] ciphergoth.livejournal.com
It turns out that the distance-based cutoff was completely broken anyway, so all solutions were found. However, fixing it has made the solver faster. I have also replaced functional composition with matrix composition for composing transforms, which is also faster.

Profile

ciphergoth: (Default)
Paul Crowley

January 2025

S M T W T F S
   1234
5678 91011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 27th, 2026 03:25 am
Powered by Dreamwidth Studios