Created
February 2, 2014 12:11
-
-
Save frazras/8767487 to your computer and use it in GitHub Desktop.
checks to see which event occurred first A or B
This file contains 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
a_occured = false | |
b_occured = false | |
function event(source){ | |
if(source==A){ | |
if(b_occured==false){ | |
a_occurred=true | |
} | |
}else{ | |
if(a_occured==false){ | |
b_occurred=true | |
} | |
} | |
} | |
if (a_occured==true){ | |
print "A occurred first" | |
} | |
if (b_occured==true){ | |
print "B occurred first" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment