Control Arrays (buttons) - urgent help needed

sarbear3686

Newcomer
Joined
Oct 8, 2004
Messages
1
Hi,

My task is to create a matchign game with 20 cards (like memory). There is no limitations on how we designs this except that i need you to keep in mind that i haven't done programming before and so i don't knwo anything like Me or all that. So far i have created the cards as 20 buttons and am trying to make an array from them....assign them numbers and then compare them to see if the cards "match" - whether they are a pair (there will be ten pairs in teh twnety cards). Once they are matched they are taken out of the game - so i guess that means i delete them from the array. However, i'm having troubel tryign to work out how i can compare the buttons - compare what exactly? - can i compare the buttons' text properties if i give them one?? Also i need the cards to be in a different position each time the cardgame is played - so i need to be able to implement a random number generator

Please, Please, Please,
If you can help me at all
Please Post asap

Thanks
 
Your request is not that difficult at all to achieve. Your on the right track, Create An Integer Array Of Say 20. Then Use A Random Number Generator To Put The Numbers In Different Locations. You Can Then Use The Number Locations To Associate Them Selves With Different Cards. Heres An Example, Lets Say The Last Card In Row 1, That Button Would ALWAYS BE Corresponded With Say The Index Of 5 In The Array.
So If You Generate A Number X For That Array, Then Let Your Program Randomly Generate Another Index In The Array Besides The One That Is Already Used And Place X For That Button As Well. If You Don't Understand What I'm saying, Let Me Know And I'll post An Example On Here For You. Good Luck

-=Simcoder=-
 
Here, I decided to attach a zip file containing a sample match game. Took about 20 minutes to make. I hope this helps you more with your project.
 

Attachments

Last edited by a moderator:
Back
Top