1
General Software Discussion / Re: Go to the folder in the registry (key)
« on: August 31, 2012, 07:13 AM »
Also, regjump by SysInternals: http://technet.microsoft.com/en-us/sysinternals/bb963880.aspx.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
I'm trying to pick two random numbers for assignment 5 of the c# school. I'm using the following codeCode: C# [Select]
private void fillFirstBoxes() { userCard1Text.Text = Convert.ToString(functions.GetRandomCard()); dealerCard1Text.Text = Convert.ToString(functions.GetRandomCard()); } ... public class Functions { private int RandomNumber(int min, int max) { return random.Next(min, max); } public int GetRandomCard() { int[] cards = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10 }; int random = RandomNumber(0, 12); return cards[random]; } }
The trouble is that 90% of the time the two numbers are the same. Occasionally (about 10% of the time) the numbers are different but it is rare. So what am I doing wrong?
I know that computer random isn't really random, but surely it only takes a tick?-mediaguycouk (March 19, 2008, 05:21 PM)