Skip to content

Instantly share code, notes, and snippets.

@philpoore
Created September 2, 2016 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philpoore/3bf0fc31ba3cef61fbe1eab55bcb3969 to your computer and use it in GitHub Desktop.
Save philpoore/3bf0fc31ba3cef61fbe1eab55bcb3969 to your computer and use it in GitHub Desktop.
function player_status(health){
if (health == 100){
return "Full Health";
}
if (health > 10){
return "Injured";
}
if (health == 0{
return "Dead :(";
}
return "Nearly Dead";
}
player_status(100); // "Full Health"
player_status(30); // "Injured"
player_status(5); // "Nearly Dead"
player_status(0); // "Dead"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment