Created
July 31, 2012 15:22
-
-
Save rpgmaker/3217778 to your computer and use it in GitHub Desktop.
Test Similar Loops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void DoSomething() { | |
while (true) { | |
var id = _rand.Next(); | |
if (id == 0) break; | |
if (id > 1) { | |
id += 1; | |
Console.Write(id); | |
break; | |
} | |
} | |
} | |
static void DoSomething2() { | |
while (true) { | |
var id = _rand.Next(); | |
if (id > 1 || id == 0) { | |
if (id > 1) { | |
id += 1; | |
Console.Write(id); | |
} | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment