Skip to content

A command line tool for finding solutions to the Puzzle-A-Day calendar

License

Notifications You must be signed in to change notification settings

mandulaj/Puzzle-A-Day-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puzzle-A-Day Solver

Buy me a Beer

A command line tool for solving the Puzzle-A-Day and providing interesting statistics about possible solutions. The solver can be restricted to only find solutions with pieces faced up/down, have a custom board layout and custom pieces altogether. It can also be instructed to find invalid solutions such as two months (Jan Feb), two days (3 14) or non existant days (Feb 31). This tool was inspired by the work done at https://www.noreply.blog/a-puzzle-a-day/ and expanded to provide an interactive experience.

The standard puzzle formulation from this Kickstarter A-Puzzle-A-Day consists of a board with Months and Days and the goal is to fit the 8 pieces onto the board with the two remaining squares showing the current date. Naturally some days have more than one solution, some can be solved with all pieces facing up, some combinations however are impossible. This tool helps to uncover it all.

Basic Usage

$ # Building using Make
$ make
$ 
$ # Find solutions for 14 March with all tiles facing down
$ ./pad mar 14 facedown

The build requires OpenMP installed

Example Run

Asciicast Demo

Advanced Features

  1. Finding solutions for alternative board layouts (Including Weekday Positions, Blank 8x8) One can change to the extended Weeek-Day puzzle by specifying 3 target positons (Day, Month, WeekDay)
$ # Find solutions for 14 March, Friday with all tiles facing up
$ ./pad mar 14 fri faceup

$ # Find solutions for Friday, Saturday, Sunday
$ ./pad sat sun fri

  1. Finding solutions for pre-placed pieces One can fix a piece position and restrict the solutions that match it
$ # Find solutions for 14 March, With Piece 7 placed at (4,1), rotated 3x and flipped
$ ./pad mar 14 7,4,1,3,1

  1. Using alternative board pieces (T-shape, Face-Up optimized) Alternative board pieces can be selected for alternative puzzle solutions
$ # Find solutions for 14 March, Using the T piece puzzle version
$ ./pad mar 14 t
$ # Find solutions for 14 March, Using the FaceUp optimized puzzle version
$ ./pad mar 14 fu8

  1. Loading custom board pices from a text file Alternative board pieces can be specified using a text files
$ # Find solutions for 14 March, Facing up, using cusom pieces defined in the `pieces.txt` file
$ ./pad mar 14 c=pieces.txt faceup

  1. Disable printing, only show solution count
$ # Only print number of faceup solutions for 14 March, not the actual placement
$ ./pad mar 14 faceup noprint

The Game

Standard Board

**************************
*Jan Feb Mar Apr May Jun *
*Jul Aug Sep Oct Nov Dec *****
*  1   2   3   4   5   6   7 *
*  8   9  10  11  12  13  14 *
* 15  16  17  18  19  20  21 *
* 22  23  24  25  26  27  28 *
* 29  30  31 *****************
**************

Week Days Board

**************************
*Jan Feb Mar Apr May Jun *
*Jul Aug Sep Oct Nov Dec *****
*  1   2   3   4   5   6   7 *
*  8   9  10  11  12  13  14 *
* 15  16  17  18  19  20  21 *
* 22  23  24  25  26  27  28 *
* 29  30  31 Mon Tue Wed Thu *
**************** Fri Sat Sun *
               ***************

Standard Pieces

  1. Symetric + 2 rotations, 48 valid positions

    # # #
    # # #
    
  2. Symetric + 4 rotations, 80 valid positions

    #
    #
    # # #
    
  3. Asymetric + 2 rotations, 82 valid positions

        #
    # # #
    #
    
  4. Symetric + 4 rotations, 96 valid positions

    #   #
    # # #
    
  5. Asymetric + 4 rotations, 151 valid positions

    #
    # # # #
    
  6. Asymetric + 4 rotations, 154 valid positions

        # 
    # # # #
    
  7. Asymetric + 4 rotations, 154 valid positions

        # #
    # # #
    
  8. Asymetric + 4 rotations, 196 valid positions

    # #
    # # # 
    

WeekDay Pieces

  1. Symetric + 2 rotations, 55 valid positions
    # # # #
    
  2. Symetric + 4 rotations, 100 valid positions
    #
    #
    # # #
    
  3. Asymetric + 2 rotations, 102 valid positions
        #
    # # #
    #
    
  4. Symetric + 4 rotations, 102 valid positions
        #
    # # #
        #
    
  5. Symetric + 4 rotations, 118 valid positions
    #   #
    # # #
    
  6. Asymetric + 2 rotations, 122 valid positions
    # #
      # # 
    
  7. Asymetric + 4 rotations, 191 valid positions
    #
    # # # #
    
  8. Asymetric + 4 rotations, 194 valid positions
    # # #
        # #
    
  9. Asymetric + 4 rotations, 240 valid positions
    # #
    # # #
    
  10. Asymetric + 4 rotations, 242 valid positions
    #
    # # #
    

Todo

  • Add easier support for Multiple Piece types
  • Support for alternate board layouts
  • Support for Days of week
  • Include tool for validating board and piece choice compatibility

About

A command line tool for finding solutions to the Puzzle-A-Day calendar

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published