
Permutations of a children's trainset visualized - mcconnma
http://www.mcconn.xyz/posts/trainset-p1/
======
ZeroGravitas
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.

------
dekhn
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...](http://www.scarm.info/blog/tutorials-and-
examples/examples-of-marklin-c-track-layout-plans-created-in-scarm/)

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.

------
czers
Author's favorite:
[https://i.imgur.com/7Z3QfF0.png](https://i.imgur.com/7Z3QfF0.png)

------
biomcgary
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.

------
cafard
John Graham-Cumming posted something like this some years ago.

~~~
mcconnma
Thanks for the name, I found the article here:
[http://blog.jgc.org/2010/01/more-fun-with-toys-ikea-
lillabo-...](http://blog.jgc.org/2010/01/more-fun-with-toys-ikea-lillabo-
train.html). However, he only solves for 16 pieces. This post and program
solves for any number of pieces.

~~~
zokier
You an jgc also use different criteria for symmetry/rotation removal,
evidenced by different count of layouts for 16 pieces (jgc 9, you 15)

~~~
mcconnma
I noticed that as well, I need to figure out what is the difference ...

------
jacquesm
related to this:

[http://www.math.ku.dk/~eilers/lego.html](http://www.math.ku.dk/~eilers/lego.html)

------
rzzzt
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](https://youtu.be/StYH6GPsddU)

~~~
jon-wood
If you enjoyed that, pick up a copy of Trackmania.

------
ant6n
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).

~~~
mcconnma
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.

------
mayoff
Fun project. The output would be easier to understand as small multiples
instead on animated gifs.

