I am developing a gambling helper app for PC.
In the gambling game there are 13 games of goal, each game has 3 options: (1) - for the first group to win, (0) - the result ends in a draw, (2) - for the second group to win.
I created a char 2d array with the size of 13x3 which the user inputs ('x' for selecting the option, 'o' for not selecting it), here is the code to make things clear:
This allows the user to select each option which he thinks that could take place (there can be more than one option for a certain game in this algorithme, but this is not the case with a real form game).
What I do not know how to do it efficiently is how to print all possible options (from the user's selection)
what I did was that I randomized the options and looped until all of them were printed (but surely very not efficient way to do things)
any help is highly appreciated
In the gambling game there are 13 games of goal, each game has 3 options: (1) - for the first group to win, (0) - the result ends in a draw, (2) - for the second group to win.
I created a char 2d array with the size of 13x3 which the user inputs ('x' for selecting the option, 'o' for not selecting it), here is the code to make things clear:
C#:
char[,] ch = new char[13,3]
for (int i = 0; i < 13; i++)
{
Console.WriteLine("Enter Game{0}:", i+1);
Console.Write("If you think group1 will win enter 'x', if not enter 'o': ");
ch[i,0] = char.Parse(Console.ReadLine());
Console.Write("If you think the game will end in draw 'x', if not enter 'o': ");
ch[i,1] = char.Parse(Console.ReadLine());
Console.Write("If you think group2 will win enter 'x', if not enter 'o': ");
ch[i,2] = char.Parse(Console.ReadLine());
}
This allows the user to select each option which he thinks that could take place (there can be more than one option for a certain game in this algorithme, but this is not the case with a real form game).
What I do not know how to do it efficiently is how to print all possible options (from the user's selection)
what I did was that I randomized the options and looped until all of them were printed (but surely very not efficient way to do things)
any help is highly appreciated
Last edited: