Created
April 16, 2013 15:52
-
-
Save IQAndreas/5397110 to your computer and use it in GitHub Desktop.
"switch" to check the minimum drinking age (sample). Comparison between AS3 and HaXe.
(partial list from http://en.wikipedia.org/wiki/Legal_drinking_age)
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
// AS3 | |
switch (country) | |
{ | |
case ITALY: | |
case LUXEMBOURG: | |
age = 16; | |
break; | |
case UK: | |
case SWEDEN: | |
case FRANCE: | |
age = 18; | |
break; | |
case USA: | |
case GUAM: | |
age = 21; | |
break; | |
case NORWAY: | |
age = 0; | |
break; | |
} | |
// HaXe | |
switch (country) | |
{ | |
case ITALY, LUXEMBOURG: | |
age = 16; | |
case UK, SWEDEN, FRANCE: | |
age = 18; | |
case USA, GUAM: | |
age = 21; | |
case NORWAY: | |
age = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment