Skip to content

Algorithm designed to solve a given HiRiQ (modified Peg Solitaire) configuration

Notifications You must be signed in to change notification settings

tianjing-li/PegSolitaire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

PegSolitaire

Algorithm designed to solve a given HiRiQ (modified Peg Solitaire) configuration INPUT: Boolean array of length 33 OUTPUT: Printing: original state, String to reach solved state (if possible), number of configs checked, solved state

example of INPUT:

boolean [] config = {false, true, false, false, true, false, true, false, false, false, false, false, false, false, true, false, true, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false}

solve(config);

OUTPUT:

      [@][ ][@]
      [@][ ][@]
[ ][@][@][@][@][@][@]
[@][ ][@][ ][@][ ][ ]
[@][@][@][@][@][@][@]
      [@][@][@]
      [@][@][@]
Moves to solve configuration: 1@9, 4@16, 6@8, 7@9, 4@16, 17@19, 15@17, 14@16
Number of configurations checked: 1137
      [@][@][@]
      [@][@][@]
[@][@][@][@][@][@][@]
[@][@][@][ ][@][@][@]
[@][@][@][@][@][@][@]
      [@][@][@]
      [@][@][@]

About

Algorithm designed to solve a given HiRiQ (modified Peg Solitaire) configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages