flet Posted July 12, 2006 Share Posted July 12, 2006 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 More sharing options...
gamepin126 Posted July 12, 2006 Share Posted July 12, 2006 You'd probably have to get a OCR to read the card types, and use PixelSearch() for suit colors and I don't know how you're going to differentiate spades from clubs. Link to comment Share on other sites More sharing options...
w0uter Posted July 12, 2006 Share Posted July 12, 2006 you could use memory functions but that would be cheating My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Zedna Posted July 12, 2006 Share Posted July 12, 2006 Look at Blackjack... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
flet Posted July 12, 2006 Author Share Posted July 12, 2006 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 More sharing options...
flet Posted July 12, 2006 Author Share Posted July 12, 2006 (edited) 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 July 12, 2006 by flet Link to comment Share on other sites More sharing options...
jvanegmond Posted July 12, 2006 Share Posted July 12, 2006 Isn't this in the wrong topic? Larry didn't notice? Waky Waky github.com/jvanegmond Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 12, 2006 Moderators Share Posted July 12, 2006 (edited) 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 July 12, 2006 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 More sharing options...
iHonda Posted July 13, 2006 Share Posted July 13, 2006 y hasnt this been moved yet?? some1 move it A great place to start Autoit 1-2-3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now