Hacker News new | ask | show | jobs
Permutations of a children's trainset visualized (mcconn.xyz)
76 points by mcconnma 3857 days ago
9 comments

Nice.

There's a note at the end that you can get more solutions by forcing a little give in the track. It's also worth noting, if you're actually buying these for your kid to play with that there's aftermarket 3rd party flexbile connectors available on Amazon, which reduces the frustration of building a really "cool" track and finding that it's not actually possible to make that final connection.

I really want this for Marklin track (HO trains). The tracks have some interesting geometric constraints, but can also produce really nice layouts: http://www.scarm.info/blog/tutorials-and-examples/examples-o...

Ideally, I'd input my platform shape and size, the list of pieces I have on hand, and then ask the engine to produce valid track layouts.

My wife and I bought a set of tracks for the kids. Then we bought a couple more sets for ourselves. We have a friendly competition to see who can build the most elaborate/aesthetics configurations. Occasionally, the kids get to play with them too.
John Graham-Cumming posted something like this some years ago.
Thanks for the name, I found the article here: http://blog.jgc.org/2010/01/more-fun-with-toys-ikea-lillabo-.... However, he only solves for 16 pieces. This post and program solves for any number of pieces.
You an jgc also use different criteria for symmetry/rotation removal, evidenced by different count of layouts for 16 pieces (jgc 9, you 15)
I noticed that as well, I need to figure out what is the difference ...
This reminds me of the C64 game Scalextric, which had an integrated level editor with blocks inspired by its real-life counterpart. There were turns covering different angles, which (at the time) made it very hard for me to create a custom level. :)

https://youtu.be/StYH6GPsddU

If you enjoyed that, pick up a copy of Trackmania.
This is very neat. When playing with this set, I've wondered about this.

...

It seems the text says for 12 pieces there are 2 solutions, but the animation shows four.

Also, there doesn't seem to be a check to see whether the bridge pieces are together. (When all 's' pieces are used there has to be at least one connected pair).

Thanks. I updated the code and the post to reflect tests for the bridge case as you mention. It affected the 12 piece and 16 piece solutions. The animated gifs are udpated and should be correct now.
Fun project. The output would be easier to understand as small multiples instead on animated gifs.