twistturns

generates dot files of the graph of all reachable states in a Top Spin puzzle
git clone https://wehaveforgeathome.hates.computer/twistturns.git
Log | Files | Refs | LICENSE

README.md (2076B)


      1 TwistTurns
      2 ===
      3 
      4 Once when I was working on some [homework](http://cs.marlboro.edu/courses/fall2008/algorithms/special/assignments#2008-09-18), I became distracted by the idea that I could graph all possible states of ["Top Spin"](http://www.jaapsch.net/puzzles/topspin.htm)-esque puzzles. After holing up in my room for two days, this project was the result.
      5 
      6 I didn't know anything about making graphs, so I offloaded that bit to [dot](http://www.graphviz.org/). While looking up ways to generate permutations, I came across ["Generation of Permutations by Addition"](http://www.jstor.org/pss/2003066), which I used to write perm_gen.c.
      7 
      8 Usage
      9 ---
     10 
     11     $ make
     12     $ ./tturns 3 2
     13     graph T {
     14     "2 1 0 " -- "1 2 0 " [color=red];
     15     "2 1 0 " -- "1 0 2 " [color=blue];
     16     "2 1 0 " -- "0 2 1 " [color=blue];
     17     "1 2 0 " -- "2 0 1 " [color=blue];
     18     "1 2 0 " -- "0 1 2 " [color=blue];
     19     "2 0 1 " -- "0 2 1 " [color=red];
     20     "2 0 1 " -- "0 1 2 " [color=blue];
     21     "0 2 1 " -- "1 0 2 " [color=blue];
     22     "1 0 2 " -- "0 1 2 " [color=red];
     23     }
     24 
     25 See samples/ for output from dot for a few values.
     26 
     27 Thanks
     28 ---
     29 
     30 * Jim Mahoney, for teaching a rad class
     31 * Binary Arts, for making an puzzle that was fun to hack about
     32 * The folks at graphiz, for writing an awesome free graphing utility
     33 * John R. Howell, for making permutations so easy I could dive in before taking that Probability class
     34 
     35 TODO
     36 ---
     37 
     38 I don't know if I'll get back to this project, but...
     39 
     40 * soup it up until it can handle 20d4
     41 * primes.c seems to be using a dingy variation of the [sieve](http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf). run benchmark on this and the related project euler [answer](http://github.com/thebigbad/proud-jack-foiler/blob/master/010/010.pl)--I can do better.
     42 * also, why does this project even need primes? before that benchmarking, see if we can pull this out entirely.
     43 * see if I can make the permutations bit more generic for I can reuse this code for the "book of tic-tac-toe" project
     44 
     45 License
     46 ---
     47 
     48 TwistTurns is released under the MIT License. See LICENSE for more details.