I'm creating a simple game (Yatzee) in C#. I have created an array which holds 5 different dice
int[] dice = new int[5];
Now, I want to create a method that throw one of these five dices. Which die that should be thrown, should be passed in as an argument in that method. So this is how I tried:
public void throwDice(int x)
{
Random r1 = new Random(6);
r1.x;
}
What I believe is happening, is that the method takes in an argument x
, that randomly should throw the dice to be a number between 1-6. But I'm getting error with when I write saying : r1.x
;
So, why I'm asking here, is if I could get some guidance. Am I on the right track here, or am I totally lost?