Use "Direction.South" inistead of just "South".
Yes there is fall-through, if by that you mean:
Code:case 1: case 2: case 3: break; default: break;
Use "Direction.South" inistead of just "South".
Yes there is fall-through, if by that you mean:
Code:case 1: case 2: case 3: break; default: break;
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
One important difference is that you cannot fall through in C#. You'll get compiler warnings if you try. You can goto other labels:
Code:switch(someNumber) { case 1: goto case 2; case 2: goto case 3; case 3: MessageBox.Show("You chose: " + someNumber); break; default: MessageBox.Show("You did not choose 1, 2, or 3."); break; }
If you understand what you're doing, you're not learning anything.