Skip to content

Instantly share code, notes, and snippets.

@CalvinRodo
Created March 7, 2014 14:32
Show Gist options
  • Save CalvinRodo/9412486 to your computer and use it in GitHub Desktop.
Save CalvinRodo/9412486 to your computer and use it in GitHub Desktop.
function bool test1(){
Console.WriteLine("Test 1");
return false;
}
function bool test2(){
Console.WriteLine("Test 2");
return false;
}
function void runtests_shortcircuit(){
if (test1() && test2()){
Console.WriteLine("Both are true!");
} else {
Console.WriteLine("Both are not true.");
}
}
function void runtests_nonshortcircuit(){
if (test1() & test2()){
Console.WriteLine("Both are true!");
} else {
Console.WriteLine("Both are not true.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment