7 ms·
Permutations of a children's trainset visualized
- cafard 11y agoJohn Graham-Cumming posted something like this some years ago.
- mcconnma 11y agoThanks for the name, I found the article here: http://blog.jgc.org/2010/01/more-fun-with-toys-ikea-lillabo-train.html 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.
- jacquesm 11y agorelated to this: http://www.math.ku.dk/~eilers/lego.html http://www.math.ku.dk/~eilers/lego.html
- czers 11y agoAuthor's favorite: https://i.imgur.com/7Z3QfF0.png https://i.imgur.com/7Z3QfF0.png
- ant6n 11y agoThis 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 11y agoThanks. 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.
- dekhn 11y agoI 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-of-marklin-c-track-layout-plans-created-in-scarm/ 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.
- ZeroGravitas 11y agoNice. 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.
- rzzzt 11y agoThis 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 11y agoIf you enjoyed that, pick up a copy of Trackmania.
- biomcgary 11y agoMy 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.
- mayoff 11y agoFun project. The output would be easier to understand as small multiples instead on animated gifs.