Skip to content

Instantly share code, notes, and snippets.

@IQAndreas
Created April 16, 2013 15:52
Show Gist options
  • Save IQAndreas/5397110 to your computer and use it in GitHub Desktop.
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)
// 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