Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not detecting the correct window sie #8

Open
Cod3e opened this issue Jan 5, 2021 · 8 comments
Open

Not detecting the correct window sie #8

Cod3e opened this issue Jan 5, 2021 · 8 comments

Comments

@Cod3e
Copy link

Cod3e commented Jan 5, 2021

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

@mchung94
Copy link
Owner

mchung94 commented Jan 5, 2021

Hi, thanks again for opening an issue! I'm still trying to replicate the problem, I know that the program will try to resize the window to 1440x900 and if the screen resolution is smaller than that then it won't work. But I'm testing to find out other ways to make it not detect the window size correctly.

@Cod3e
Copy link
Author

Cod3e commented Jan 6, 2021

Any fix? isuggest making the program ask for the scrn rez for window size

@mchung94
Copy link
Owner

mchung94 commented Jan 7, 2021

No fix yet, can I ask what your screen resolution is? The tricky part is the card image detection often makes mistakes if the game window isn't 1440x900, because the cards will be too small, and so everything has been hardcoded to work with 1440x900 window.

@Cod3e
Copy link
Author

Cod3e commented Jan 7, 2021

Somewhat 1000x700

@Cod3e
Copy link
Author

Cod3e commented Jan 8, 2021

correction 1366x768. I suggest doing a manual mode if you don't want to do the images.

AKA you tell it the cards and it prints out a soution. (also explain what is with the numbers like K1 Q2 J5)

@mchung94
Copy link
Owner

mchung94 commented Jan 9, 2021

I'll try to work on a fix but in the meantime there is a already way to tell it the cards and make it print out the solution.

If you create a text file with the cards in it like the pyramid-deck.txt and tripeaks-deck.txt examples below, then you can send it to the solver using a command line.

All the cards use two letters or numbers:
The first letter or number is the value or rank of the card:
A = Ace
2 = Two
3 = Three
4 = Four
5 = Five
6 = Six
7 = Seven
8 = Eight
9 = Nine
T = Ten
J = Jack
Q = Queen
K = King

The second letter is the card's suit:
c = Clubs
d = Diamonds
h = Hearts
s = Spades

So As = Ace of Spades, 7d = Seven of Diamonds, Th = Ten of Hearts, etc.

Here are example text files of games of Pyramid and TriPeaks solitaire:
pyramid-deck.txt
tripeaks-deck.txt

For example if you run: solitaire-player.bat pyramid score -f pyramid-deck.txt
It'll print out this (ignore the stuff like [22, Stock] just look at the cards like 6s, 8d):
Starting a Pyramid Solitaire Score Challenge: find the maximum possible score...
Solution: Clear the board, gain 1290 score in 43 steps.
Draw
Draw
Remove [6s, 8d] ([22, Stock])
Draw
Remove [5c, 9h] ([24, Stock])
Draw
Remove [8s, 6d] ([23, 26])
Remove [Tc, 4d] ([16, 21])
Remove [Ks] ([16])
Remove [9c, 5d] ([10, Stock])
Draw
Remove [Kd] ([Stock])
Draw
Remove [Qs, Ad] ([Waste, Stock])
Remove [3h, Js] ([Waste, Stock])
Remove [Jc, 3s] ([Waste, Stock])
Remove [7s, 7c] ([17, Waste])
Draw
Draw
Remove [6h, 8h] ([25, Stock])
Remove [Kc] ([Stock])
Remove [Kh] ([Stock])
Draw
Remove [Qd, Ah] ([19, Stock])
Draw
Draw
Remove [4d, 9s] ([18, Stock])
Remove [Jd, 2c] ([12, Waste])
Draw
Recycle
Remove [6c, 7d] ([11, 13])
Remove [As, Qc] ([6, Stock])
Draw
Draw
Remove [2d, Jh] ([8, Stock])
Remove [3h, Td] ([7, Stock])
Remove [7h, 6h] ([4, 27])
Remove [Ac, Qh] ([20, Waste])
Remove [Th, 3c] ([14, Waste])
Remove [9d, 4s] ([9, Stock])
Remove [4h, 9c] ([3, 5])
Remove [Ts, 3s] ([1, 2])
Remove [8s, 5c] ([0, Stock])

If you run: solitaire-player.bat tripeaks -f tripeaks-deck.txt
It will print out this:
Starting a TriPeaks Solitaire Board Challenge...
Clear the board in 40 steps
Draw a card from the stock pile
Draw a card from the stock pile
Move the tableau card Jc (index=19) to the waste pile
Move the tableau card Qd (index=24) to the waste pile
Move the tableau card Kc (index=22) to the waste pile
Move the tableau card Ah (index=21) to the waste pile
Move the tableau card 2c (index=12) to the waste pile
Move the tableau card 3d (index=18) to the waste pile
Move the tableau card 2d (index=25) to the waste pile
Move the tableau card 3c (index=15) to the waste pile
Move the tableau card 4s (index=26) to the waste pile
Move the tableau card 5d (index=16) to the waste pile
Move the tableau card 6d (index=23) to the waste pile
Move the tableau card 7d (index=20) to the waste pile
Move the tableau card 8c (index=11) to the waste pile
Draw a card from the stock pile
Move the tableau card Ad (index=27) to the waste pile
Move the tableau card 2s (index=10) to the waste pile
Draw a card from the stock pile
Move the tableau card 9s (index=17) to the waste pile
Move the tableau card Th (index=13) to the waste pile
Draw a card from the stock pile
Move the tableau card 5h (index=8) to the waste pile
Move the tableau card 6s (index=4) to the waste pile
Draw a card from the stock pile
Move the tableau card 2h (index=14) to the waste pile
Move the tableau card As (index=5) to the waste pile
Move the tableau card Kd (index=9) to the waste pile
Draw a card from the stock pile
Move the tableau card 8s (index=3) to the waste pile
Draw a card from the stock pile
Draw a card from the stock pile
Move the tableau card 7s (index=6) to the waste pile
Move the tableau card 8h (index=0) to the waste pile
Draw a card from the stock pile
Draw a card from the stock pile
Move the tableau card 4d (index=7) to the waste pile
Move the tableau card 3h (index=1) to the waste pile
Draw a card from the stock pile
Move the tableau card Qc (index=2) to the waste pile

@mchung94
Copy link
Owner

mchung94 commented Jan 9, 2021

Also if you run "solitaire-player.bat help" it may help describe it better than how I just did.

For the tripeaks-deck.txt example, 6h (Six of Hearts) is the face up card at the bottom where all the cards go when you click them. Jd (Jack of Diamonds) is the first face down card in the stock pile, and Kh (King of Hearts) is the very last face down card.

For the pyramid-deck.txt example, Qc (Queen of Clubs) is the first face down card in the stock pile and 5c (Five of Clubs) is the last face down card in the stock pile.

@Cod3e
Copy link
Author

Cod3e commented Jan 13, 2021

now im getting this: (scrn rez correct) Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/secondthorn/solitaireplayer/app/CommandLineMain has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants