Jump to content

AutoIt playing solitaire


flet
 Share

Recommended Posts

As my first AutoIt project, I have chosen to build a computer program that solves a game of solitaire for me.

I think the Artificial Intelligence won't be that difficult, but I have some problems with recognizing the graphics. (I have no source code yet, tried a few things with pixels, but I deleted them afterwards)

How would you approach the problem? How can I recognize the cards on the table?

Can it be done with PixelChecksum()? Any ideas are welcome, because I'm stuck at the moment..

Link to comment
Share on other sites

gamepin126: I was afraid that I had to do something like you are suggesting. I hoped that there would be an easier way to do it. OCR souds a little bit complicated for me, as I am an AutoIt noob. Maybe I should look out for a more simple project to begin with, but I'll give OCR a try. There are some interesting posts on this form about OCR. The only fear I have, is that the program becomes too slow.

w0uter: I don't like cheating. I'd rather lose than win a game with cheating.

Zedna: I don't see what a blackjack game has in common with card recognition in solitaire. I don't want to draw cards myself. How can I use `cards.dll' to recognize cards on my solitaire table?

Link to comment
Share on other sites

OK, with pixelchecksum(), I'm drawing the smallest square possible around the rank and the suit of a card. However, sometimes, the checksum is the same for two different cards:

card checksum

3d 2130154405

4d 724888128

6d 4281195598

7d 4281195598

9d 102357584

Td 521127524

Jd 1496215483

In the table above, read 3d as: the three of diamonds, etc.

Note that the checksums for 6d and 7d are the same.

How is this possible, how is the checksum for the square of pixels calculated anyways?

Edited by flet
Link to comment
Share on other sites

  • Moderators

Hmm, my checksums were different, are you sure this is for solitaire?

Edit:

I got

6d: 2802593504

7d: 2890732284

For the same coords being used for both.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...