Skip to content

Instantly share code, notes, and snippets.

@IhwanID
Created January 30, 2020 05:21
Show Gist options
  • Select an option

  • Save IhwanID/cb8035c4753580e9f828c19e43b3de80 to your computer and use it in GitHub Desktop.

Select an option

Save IhwanID/cb8035c4753580e9f828c19e43b3de80 to your computer and use it in GitHub Desktop.
enum
void main() {
printStatus(Status.Start);
}
enum Status{
Start,
OnGoing,
Finish
}
void printStatus(Status status){
switch(status){
case Status.Start:
print("starting . . . ");
break;
case Status.OnGoing:
print("onGoing . . . ");
break;
case Status.Finish:
print("finish . . . ");
break;
}
if(status == Status.Start){
print("starting . . . ");
}else if(status == Status.OnGoing){
print("onGoing . . . ");
}else{
print("finish . . . ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment