i need to create a simple memory game in c# (console) ,a board with hidden cards must be generated , behind the cards i need to have randomly selected chars from A-Z. i have created a class called Table , containing a matrix of chars. ive also created a method which suppose to randomly fill the matrix with chars
public void set_table_values()
{
int i=0,randchar=0;
Random board_filler = new Random() ;
while(i< Height)
{
int j = 0;
while (j<Width)
{
randchar=board_filler.Next(0, 26);
Table_matrix[i, j] = (char)('A'+randchar);//table matrix is a private member inside the class
j++;
}
i++;
}
the problem is that in order for the game to work i need that every random char will be created twice , and in random locations. im kinda stuck and the only idea i had is too much complicatied, any advice?