Identify solutions to the classic triangle+pegs bar game
-
Install the package and requirements
$ pip install git+git://github.com/jayhale/triangles.git#egg=triangles
-
Initialize the database to save results
$ triangle db init Initializing the database at triangles.db
-
Find all feasible board configurations and all solutions (~2 hrs, mostly to build the DB)
$ triangle solve Finding all feasible solutions with position 14 initially empty Incrementing boards (1 ): [####################################] 100% ... Incrementing boards (162558): [####################################] 100% Saving results to the database Saving boards (won=1): [####################################] 100% Saving boards (won=0): [####################################] 100%
-
View a configuration (the "bowtie" configuration is
b'111111111101000'
or 32744)$ triangle view configuration 32744 Configuration 32744: 111111111101000 ● ● ● ● ● ● ● ● ● ● ○ ● ○ ○ ○
-
List sequences for a configuration