![]() |
| ||
| memory game Hi all i am working on a memory game and i am having problems inputing the data so it checks if a 3rd number is pulled up to ignore it thanks in advance int card[6][6],total=0,value,test; |
| ||
| Re: memory game It might help to describe how the game works and how your program logic accomplishes that. Saying that you need some code for the program to ignore a 3rd number that's pulled up means nothing to us. |
| ||
| Re: memory game well it is a memory game where you match 2 numbers and i want random numbers between 0 and 17 on the board i need 2 of the same number on the board |
| ||
| Re: memory game So you want to populate the board with random numbers in the range of [0, 18) and disallow more than two of a kind? I'd say use a frequency table for the range since it's small, and repeat getting the random number until you find one that doesn't go beyond the limit: #include <cstdlib>The frequency table holds a count of all of the values in your range. |
| ||
| Re: memory game oh wow that is a different way thinking about it. thanks |
| All times are GMT -4. The time now is 5:45 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC