Skip to content

Instantly share code, notes, and snippets.

@nulledge
Created March 30, 2018 09:43
Show Gist options
  • Save nulledge/37f4ed7fff318b453e131fe7ebc18c53 to your computer and use it in GitHub Desktop.
Save nulledge/37f4ed7fff318b453e131fe7ebc18c53 to your computer and use it in GitHub Desktop.
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