I decided to waste my time by writing a script to solve minesweeper. I really have no intentions of this working or being of any use but i need to get my programming skills up again. I've ran into a few problems with my arrays.
Ideally (I think...correct me if i'm wrong) I'll have a two-dimensional array to describe where each of the 64(on beginner) little 15x15 pixel square is. And i'll have an array of 10 elements to hold the information in the square (1..8, empty, filled).
I will have the program look at the 2D array to look through the squares and then use bitmap recognition to decide what information is in the square.
Eventually of course i will have to make some sort of variable system to handle the information in the surrounding 8 squares and act accordingly, but one bite at a time right?
The part where i have trouble with is defining my 2D array. How can i have each element of that be a 15x15 pixel square? I can obviousy make an array by having ('a'..'h',1..8) but how can i define each element by a square? i'm pretty new to arrays (about 36 hours since i learned about them) so any info would be great.
Thanks!
Ransom



Reply With Quote









While browsing the delphi stuff i ran across the TRect class and i think i'm going to use that one. I can put in the coords using an x,y formula type thing and it will give me the exact coods of the rectangles top, bottom, right and left. That way i can spit them back out when i'm doing FindBitmapToleranceIn() Or something else along those lines that takes 4 points to a rectangle.
h): any takers?