Ok, here it would be possible to "code blind".
The graphics (sprites) really are just extra.
So, if you set up an array, you can keep track of the playing field.
If you don't understand arrays, here is my explanation that I gave to some others and it helped them out:
Quote: "
Arrays are essentially variables that can hold more than a single number. They are referenced through a coordinate like numbers.
A good way to think of arrays are like filing cabinets. First you have the variable name, which is the unit itself. It can be, just like a variable, an integer, a float (containing decimals), or a string (words). The number of drawers is the first number (so dim checkdata(3) would have 3 drawers). From there, you can sub-divide each drawer with folders, for arrays, it would simply be the next number, signifying how many "folders" for each drawer.
So:
dim apples(3,2) would, to keep up the analogy, a filing cabinet with 3 drawers, and 2 folders in them (just to throw this out there, you CAN use and store data to apples(3,0) but that should only be used if it makes the code easier to read (don't go out of your way if you don't have to).
Now, since this is a computer, you can subdivide every drawer infinitely (to a point, but you will probably run out of memory before you hit the extents) as well as every folder. Inside each folder, though, is a piece of paper, which simply has a number or string (depending on the type) printed on it. This is what the value of that folder is.
"
So, if you have a 5x5 card field, you could use:
DIM playing_field(5,5)
Then, for the third card in the first row, you could store the card number by:
playing_field(3,1)=8
So that way, you choose 2 cards and then compare their number (so if card (3,1) and (2,5) are chosen, you reference playing_field(3,1) and playing_field(2,5) respectively).
Make sense?
Also, 2 important things about forum etiquette
1. Don't post your age...EVER. Yes, we are all cool people here, but it is STILL NEVER a good idea to post your age online. You can say, I am new to programming, or still in High school, but no age.
2. Enclose your code in code brackets. Just highlight it and click the code button. It will look like:
load bitmap "cards.bmp",1
b=0
c=1
for a=0 to 12
get image c,0,b,75,(b+100)
b=b+101
c=c+1
next a
x=1:y=1:x2=76:y2=1:x3=151:y3=1:x4=201:y4=1
x5=251:y5=1:x6=301:y6=1:x7=351:y7=1:x8=401:y8=1
x9=1:y9=101:x10=51:y10=101:x11=101:y11=101:x12=151:y12=101
do
sprite 1,x,y,1:sprite 2,x2,y2,2:sprite 3,x3,y3,3:sprite 4,x4,y4,4
sprite 5,x5,y5,5:sprite 6,x6,y6,6:sprite 7,x7,y7,7:sprite 8,x8,y8,8
sprite 9,x9,y9,9:sprite 10,x10,y10,10:sprite 11,x11,y11,11:sprite 12,x12,y12,12
loop
And 1 point about code tidyness (don't know if you already know this since the forums don't preserve spacing):
If you indent your code, it makes it easier for us to read, and easier for you to catch mistakes as you make them.
So, it could look like:
load bitmap "cards.bmp",1
b=0
c=1
for a=0 to 12
get image c,0,b,75,(b+100)
b=b+101
c=c+1
next a
x=1:y=1:x2=76:y2=1:x3=151:y3=1:x4=201:y4=1
x5=251:y5=1:x6=301:y6=1:x7=351:y7=1:x8=401:y8=1
x9=1:y9=101:x10=51:y10=101:x11=101:y11=101:x12=151:y12=101
do
sprite 1,x,y,1:sprite 2,x2,y2,2:sprite 3,x3,y3,3:sprite 4,x4,y4,4
sprite 5,x5,y5,5:sprite 6,x6,y6,6:sprite 7,x7,y7,7:sprite 8,x8,y8,8
sprite 9,x9,y9,9:sprite 10,x10,y10,10:sprite 11,x11,y11,11:sprite 12,x12,y12,12
loop
Now for some general comments about your code (you didn't do anything wrong, but it could be done better).
x=1:y=1:x2=76:y2=1:x3=151:y3=1:x4=201:y4=1
x5=251:y5=1:x6=301:y6=1:x7=351:y7=1:x8=401:y8=1
x9=1:y9=101:x10=51:y10=101:x11=101:y11=101:x12=151:y12=101
This section, one statement: use arrays. Using 2 arrays you could do:
Dim X(12)
Dim Y(12)
Not sure what it is for, though, so you could use a single array if it is for a playing field and just multi-dimention it like so:
DIM field(12,12) where the first number will represent the width in cards and the second is the height in cards.
And Finally:
sprite 1,x,y,1:sprite 2,x2,y2,2:sprite 3,x3,y3,3:sprite 4,x4,y4,4
sprite 5,x5,y5,5:sprite 6,x6,y6,6:sprite 7,x7,y7,7:sprite 8,x8,y8,8
sprite 9,x9,y9,9:sprite 10,x10,y10,10:sprite 11,x11,y11,11:sprite 12,x12,y12,12
loop
I usually try to stay away from multiple lines of code on one line like this. It just makes it harder to track bugs. If I were to tell you that you made a mistake on the second line, how would you know which one it was? You would have to check 4 commands to find the typo. Whereas if you put them on their own line it is easier to track.
Here is a cool thing though: you can do all of this in 3 lines if you use the X(12) and Y(12) arrays. Don't believe me? Check it out:
For i=1 to 12
SPRITE i,X(i),Y(i),i
Next
Hope this helps. Let me know if I can clear anything up!
Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose