Created
March 30, 2018 09:43
-
-
Save nulledge/37f4ed7fff318b453e131fe7ebc18c53 to your computer and use it in GitHub Desktop.
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
var cond_A = 1, cond_B = 2 | |
var ret_A = 10, ret_B = 20, ret_C = 30 | |
for (cond = 1; cond <= 3; cond ++) { | |
var ret = cond == cond_A ? ret_A : cond == cond_B ? ret_B : ret_C | |
print(cond, ret) | |
} | |
/* Return | |
1 10 | |
2 20 | |
3 30 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment