mchung94 / solitaire-player

Automatically play Pyramid and TriPeaks Solitaire in Microsoft Solitaire Collection for Windows 10
MIT License
39 stars 15 forks source link

Logic Priorities & other QoL Improvements #22

Open Konungrr opened 2 years ago

Konungrr commented 2 years ago

With Pyramid, it's pretty simple, just run the score solver for all 3 challenges since the top of the pyramid is worth the most points, it will always try to clear the board, and will attempt to get every match possible.

With Tripeaks, it's not so simple. The default board solver logic is very unoptimized and will skip past available cards and break up chains into smaller chains for no reason.

This wouldn't be a problem except for the fact that on some Score challenges, the highest possible score on a board is obtained without clearing the board, and if you are on a 1 deal challenge, will lose the challenge.

This results in having to run the board solver, which as already stated, does not prioritize points in any way and seems to actually prefer going with the lowest possible score.

Example: January 6 Daily Challenge, TriPeaks Expert Score Challenge.

Suggestion:

When using the TriPeaks Score Solver, if the maximum possible score does not clear the board, find a solution that does, provide both solutions with an option for which to run, or; Incorporate a score priority into the board solver so it will solve but also obtain a higher score.

If not run with --show-prompts, automatically bring up the dialog box with the duplicate card, which is always the QC/QS, instead of ending the solve process and having to start all over. Or better yet, simply remove the necessity of suit all together. Suit does not factor into either of these games at all, and if it just checked if there were exactly 4 of each Rank, it probably would never fail that specific check.

Increase the speed.

Thank you for taking the time and also for all your valuable work on this amazing program!

Konungrr commented 2 years ago

On the January 6 Expert Score Challenge, you get both examples of the issues with the TriPeaks solvers, both Score and Board:

Running the Score Solver, it offers 32200 points in 49 steps, but leaves 2 cards on the board. Running the Board Solver, it will clear the board, but in the 8th step it draws from the deck when it shouldn't:

Move the tableau card 2h (index=14) to the waste pile Draw a card from the stock pile Move the tableau card 3s (index=25) to the waste pile Move the tableau card 4h (index=16) to the waste pile

The Drawn card is the 2c, so if didn't draw, it would generate a longer chain and keep the multiplier. Just this one instance is 400 extra points for this 3 chain.

This optimization would also improve the speed of the solve since it wouldn't need to move the mouse from the middle of the board back down to the deck and back up again, but stay in the middle of the board.