Heres a tiny function to randomly return either +1 or -1
public static int PlusOrMinus()
{
int chance = MyRandom.Random.Next(0, 2);
switch (chance)
{
case 0:
return -1;
case 1:
return 1;
}
}
Compiler is telling me not all code paths return a value. As far as I'm concerned its impossible for chance not to be either 0 or 1.
Must you always include a default case for a switch statement like this to compile?