int numRangeFloor;
switch (hardness)
{
case 1:
numRangeFloor = 5;
break;
case 2:
numRangeFloor = 10;
break;
case 3:
numRangeFloor = 100;
break;
}
Random difficulty = new Random();
difficulty.Next(0, **numRangeFloor**);
Edit: For those that haven't memorized all the codes:
CS0165 is "Use of unassigned local variable 'name'"