Skip to content
/ trains Public

Track generator for IKEA LILLABO and LEGO DUPLO train sets

License

Notifications You must be signed in to change notification settings

mmm444/trains

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trains

Track generator for IKEA LILLABO and LEGO DUPLO train sets.

My son got Lego Duplo Deluxe Train Set for Christmas and I was thinking what tracks could be built from the parts in the box. This program finds them all by using a brute force search with some primitive branch pruning.

It was built as faster version of the program presented by John Graham-Cumming in his blog post.

Install

go get -u github.com/mmm444/trains

Run

To generate all the tracks for Lego train set run

trains

and it will output some HTML and SVG to the current directory. On my machine it takes about 20s to find all 2036 tracks.

If you want to genrate all the IKEA LILLABO tracks run

trains -ikea -c 12 -s 2 -b 1

TODO

  • eliminate more symmetrical tracks from the result
  • support switches from the Duplo Train Acccessory Set
  • beautify the code
  • beautify the output

About

Track generator for IKEA LILLABO and LEGO DUPLO train sets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages