Giter Club home page Giter Club logo

solitaire-player's People

Contributors

mchung94 avatar rodan123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solitaire-player's Issues

Logic Priorities & other QoL Improvements

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!

"can't detect if we're playing a game of Pyramid Solitaire"

I am running Windows 10 Pro Version 21H1 OS Build 19043.1202 Windows Feature Experience Pack 120.2212.3530.0

My native screen resolution is 3840x2160. I have a dual monitor setup with a smaller resolution screen, but even when I disconnect that monitor, I get the same error message:

Starting a Pyramid Solitaire Score Challenge: find the maximum possible score...
System Report:
    Window Size (after adjustment) = 1440x977
    Expected Window Size = 1440x900
    DPI = 192
    Expected DPI = 96
    Scaling Factor = 200.0%
    Primary Screen Size (Adjusted for Scaling Factor) = 1920x1080
    Expected Primary Screen Size = 3840x2160
If the scaling factor isn't 100% or the values don't match the expected,
then this program may not work properly.
Can't detect if we're playing a game of Pyramid Solitaire.

Any ideas on how to fix this? I am only able to solve at this point by creating a pyramid-deck.txt and running the solitaire-player.bat pyramid score -f pyramid-deck.txt.

Tripeaks Other layouts

Is there any support for other tripeaks layouts?

Having not looked at the code yet, how difficult would it be to add?

I will look into doing it if its something that would not be too difficult.

Only asking about the command line version where you can supply a file with a deck in it.

Thanks

Microsoft Solitaire Collection has been updated

There's a new update to Microsoft Solitaire Collection, where the graphics, position of cards in the window, and the Undo Board / OK buttons have changed. So the program won't be able to detect the cards and play the game properly.

I'll be working on an update to keep the program working, but I won't be able to properly support 200% and 250% windows display scaling anymore, only 100%.

Optimization || draws new card when not neccessary

When trying to find a solution it often draws from the stockpile even when that same card is on top of the pile (tripeaks) for example if an ace is on top it often clicks until the next ace to clear a king instead of clearing the king with the ace already on top. Sometimes this also happens when a solution is found and solving.

solitaire-player stopped recognizing club suit cards

Hearts, spades and diamonds are recognized just fine. Clubs are miss-ID'd as spades. I've de-installed Java and removed the bin and lib folders, then reinstalled Java and downloaded a fresh copy of the solitaire-player .zip file. Program had been working fine until a few weeks ago. Windows 10 operating system w/32GBytes sdram, an Intel Core i7 5930K CPU, and an NVIDIA GeForce GTX 970 graphics card. No abnormal behavior to report elsewhere in the system.

Any suggestions will be most welcome! Thanks...

TriPeaks card reveal might hit the last card but not able to read

Thanks for your great work!

While playing with TriPeaks, it encountered an issue of hitting the last card but not able to read the card.
Please see the video upload to Youtube: https://youtu.be/pPyYPN7aS04

The card file is attached as a reference:

tripeakscards20230108120036.txt

May be there is a fix on TriPeaksPlayer.java as,

private List<String> scanCardsOnScreen(TriPeaksWindow window) throws InterruptedException, PlayException {
    window.undoBoard();
    List<String> cards = new ArrayList<>();
    for (int i = 0; i < 28; i++) {
        cards.add(window.cardAtTableau(i));
    }
    cards.add(window.cardAtWaste());
    for (int i = 0; i < 22; i++) {
        window.draw();
        cards.add(window.cardAtWaste());
    }
    cards.add("??");
    return cards;
}

protected boolean isValidCards(List<String> cards,
                               List<String> missing,
                               List<String> duplicates,
                               List<String> malformed,
                               long numUnknownCards) {
    return ((cards.size() == 52) &&
            (0 <= missing.size()) &&
            (missing.size() <= 19) &&
            (duplicates.size() == 0) &&
            (malformed.size() == 0) &&
            (0 <= numUnknownCards) &&
            (numUnknownCards <= 19));
}

No Moves Remaining in TriPeaks

Background: the program has a problem in TriPeaks when there are no moves remaining. The dialog box changed, so the program does not understand when this occurs.

I think for now, I can try to look for the English text, and handle problems with other languages as they come up.
I'll also need to handle the situation where I try to undo the last move, but an advertisement starts to play.

suggestion: --show-prompts, but only for duplicates

as many have said, thank you for this! I'm thinking of trying to write a Spider player, but it's been 20 years since I've ever coded anything this complicated (and don't really know java)! Should be a fun project once I get into it.

One suggestion... --show-prompts prompts you at the initial scan, any duplicates, and for permission to solve. I would like to see --show-error switch that only pops up when duplicates are detected so they can be corrected. This would make living with the Queen of Clubs issue easier. :)

Optimization <<

When trying to find a solution it often draws from the stockpile even when that same card is on top of the pile (tripeaks) for example if an ace is on top it often clicks until the next ace to clear a king instead of clearing the king with the ace already on top. Sometimes this also happens when a solution is found and solving.

Optimization and UX improvement ideas

I've been playing with the program for a while. A few things I'd like to see if possible.

1: Eliminate case sensitivity on command line arguments:
Be able use >solitaire-player tripeaks score 30000 12000 as well as >solitaire-player TriPeaks Score 30000 10000

2: Add option to skip verify/confirm prompts:
I've never had an issue with the program identifying the initial layout of cards. It would be nice to have the option to skip that step, and the prompt before asking if one wants it to solve the puzzle. These may be useful if you want to enter any additionally known cards at the start, but generally, I'm happy to trust it to identify and work through the solution mostly unattended.

3: Combine first & 2nd passes in TriPeaks:
I believe the current solve logic is to, on the first pass, Identify the cards in the deck and the face up cards at the bottom of the tableau. The 2nd step is to recursively attempt to uncover the remaining face down cards until it can identify all 52 cards, and then in the final step it solves the game from start to finish. I believe it might be more efficient if the first pass included efforts to uncover hidden cards in the tableau as well. As once it identified all the cards in the deck, it would almost certainly have fewer than 18 unknown cards to identify in the 2nd recursive step which may require fewer undos overall.

Thanks!

MS Solitaire new version graphics changes

Microsoft has released a new version of Solitaire.
MS-Sol-version

The new version changes many of the screen graphics used by solitaire-player to identify items.

FreeCell execution results in "Can't detect if we're playing a game of FreeCell Solitaire."

Pyramid execution results in "Can't detect if we're playing a game of Pyramid Solitaire."

TriPeaks execution does work but the end of game graphic has changed.
MS-Sol-TriPeaks-EOG-dialog-box

The bottom menu bar has changed.
MS-Sol-TriPeaks-bottom-menu-bar

Microsoft has included a new Solver function in this version.

Thank you.

It shows "?" in everywhere

  ??          ??          ??
??  ??      ??  ??      ??  ??

?? ?? ?? ?? ?? ?? ?? ?? ??
?? ?? ?? ?? ?? ?? ?? ?? ?? ??
??
?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??

my screen: 1920x1080
Windows 10 64 bit

I installed OpenJDK 11 (LTS) jdk-11.0.4+11 and OpenJDK11U-jre_x64_windows_hotspot_11.0.4_11

it isnt working. what's the problem?

weekly rewards - can't detect game

Microsoft has added a new rewards feature to Solitaire Collection. The version installed is 4.12.3171.0. When you receive a bonus game, the title bar is different from regular games. Here is an example.

Bonus-Game

The solitaire-player aborts with the error "Can't detect if we're playing a game of Pyramid Solitaire."

Not detecting the correct window sie

Hello it is i again just gonna let you know that the program does not detect the window size correctly and sizes it ABOVE the screen rez resulting in an offset

The Solver error

Heya when i tried using the TriPeaks Solver it just threw me a bunch of errors (I do have java) and crashed.
Could ya give me some spider freecell or Klondike Solvers? Or atleast write how to use them. I can provide proof for the errors.

Microsoft update to Solitaire

Microsoft has updated the Solitaire game to version 4.12.2180.0. Since the update, when I run the solitaire-player.bat I get this message.

Unable to find, move, or show the Microsoft Solitaire Collection window.

I was able to run solitaire-player.bat successfully before the update.

The mouse cursor points at a wrong section to click "undo all"

Hello,

I really enjoy your program so far! I had a slight concern (especially the TriPeaks) about your program: the mouse cursor points in the wrong part after i click ok after scanning. It is supposed to click "undo all," but it went to the wrong way and produced erroneous solutions even though there is a solution. While this is corrected manually, it is pretty annoying. Thank you!

Misreading Qc

Hi, thanks for making and sharing this program. It works great, but I've noticed one issue showing up. I've used this a lot today, and on multiple occasions their was a problem with Qc being read as Qs when it was in the 4th row from the top, 3rd card in, position 8 from your numbering system. I've been having the prompt show and correcting it, but I wanted to let you know that it was happening. Thanks again.

new version - Microsoft Solitaire

I received a new version of solitaire (4.16.3140.0).

MS-Solitaire-version-info

This new version changes many of the graphics for the game and breaks the solitaire-player code for both pyramid and tripeaks.

Normally, your code would click through the stock pile to identify the cards, then click the Undo All button. That mouse move and click are not executed with the new version of the Microsoft game. I have been able to move the mouse and click Undo All and your code will proceed normally. I have to watch the action because I have to move the mouse and click Undo All when the program has either solved the deck or needs to recycle the stock pile to continue to identify the cards on the tableau.

I'm not sure if this will help, but I have attached the output of an execution of tripeaks.

tripeaks-test-01.txt

Java information
c:>java -version
openjdk version "11.0.18" 2023-01-17
OpenJDK Runtime Environment Temurin-11.0.18+10 (build 11.0.18+10)
OpenJDK 64-Bit Server VM Temurin-11.0.18+10 (build 11.0.18+10, mixed mode)

Couple of suggestions

1) Please make the solver a little bit more fast or at-least 1.5X or 2X of current speed.

  1. Have an option if user manually move the cursor away from the game UI, pause the execution and ask if he wants to continue or stop.
  2. If there is no solution found, instead of lopping the deck over and over, ask user to stop or prompt accordingly.

Error when opening the solver app - please help... (Sorry, I know nothing about programming, I just need help.)

So when I first tried to open the app, it didn't open because I had to extract all files from the folder. I did that, but now when I open it, this happens: an error message from the windows system 32 running thing opens up for a fraction of a second and disappears again. I managed to get a screenshot of it. What should I do? Here is the screenshot.
(https://user-images.githubusercontent.com/112972098/188698743-e484ae6d-8e93-4e48-983a-d85c8cb7c3e1.png)

Hello!

is there any solver for klondike , freecell & spider?

Log4j dependency

I was testing the solver with newer "log4j" jars and it is working without any issues till now. Please consider to upgrade all the jars:

List of newer jars used:

  • log4j-core-2.17.1.jar
  • log4j-over-slf4j-1.7.32.jar

There is no isues with slf4j jar but i thought to upgrade anyways.

Wait time between clicks & support for other decks?

Hi!
Thanks for your solitaire solver! A great little piece of software!

This is not a report of an issue, rather it's a request for future versions.
Could you add support for changing the sleep&wait time between clicks? The Microsoft Solitaire seems to be much more responsive than the ca. 1 second between clicks. It would be useful to be able to change the click speed with an argument option.
If this is in conflict with the "undo-all" time, will it be possible to have a separate sleep time when the program clicks on the undo-all button? This button is always located away from everything else.

Another useful feature would be support for more than the standard deck, although I understand that this would require more work than my first request.

Incorrect score calculation for TriPeaks games

Score is overestimated for TriPeaks games and in TriPeaks tests.

Score method in solvers/tripeaks/ScoreChallengeSolver.java should be calculated as total += 100 + streak * 200; instead of total += 300 + streak * 200;
MAX_POSSIBLE_SCORE should be 84900.

Tests will need to be updated to ensure correct functionality.
See my fork for my fixes.

Can't detect Pyramid Solitaire

It seems it does not detect Pyramid Solitaire even though i'm playing it
TriPeaks working fine and I have changed system language to english (US)

Starting a Pyramid Solitaire Board Challenge...
System Report:
    Window Size (after adjustment) = 1440x900
    Expected Window Size = 1440x900
    DPI = 96
    Expected DPI = 96
    Scaling Factor = 100.0%
    Primary Screen Size (Adjusted for Scaling Factor) = 1920x1080
    Expected Primary Screen Size = 1920x1080
If the scaling factor isn't 100% or the values don't match the expected,
then this program may not work properly.
Can't detect if we're playing a game of Pyramid Solitaire.

Tri peaks broke after seeing cards

i was running this for the first time then after seeing the cards in the deck it didn do anything just said the cards no prompt or anything else in command line (i renamed the player to have .bat at the end)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.