Skip to content

Latest commit

 

History

History

drive-ya-nuts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Drive Ya Nuts

I developed the solution to the Drive Ya Nuts puzzle. There are 7! * 6^6 = 235,146,240 ways that the pieces can be arranged on the board. I solved the physical version years ago, but I thought it would be fun to go back and solve it programmatically.

The solution uses recursive depth-first search to find mismatches as quickly as possible. This ended up being considerably faster than checking every permutation of all pieces' placement.

Example Output

          -----
         /  6  \
        / 1   5 \
  ----- \ 2   4 / -----
 /  4  \ \  3  / /  6  \
/ 6   2 \ ----- / 4   2 \
\ 1   5 / ----- \ 1   3 /
 \  3  / /  3  \ \  5  /
  ----- / 5   1 \ -----
  ----- \ 4   6 / -----
 /  3  \ \  2  / /  5  \
/ 2   4 \ ----- / 6   3 \
\ 1   5 / ----- \ 1   2 /
 \  6  / /  2  \ \  4  /
  ----- / 5   1 \ -----
        \ 6   4 /
         \  3  /
          -----