Skip to content

Instantly share code, notes, and snippets.

@lijiang2087
Created March 21, 2013 21:49
Show Gist options
  • Save lijiang2087/5217123 to your computer and use it in GitHub Desktop.
Save lijiang2087/5217123 to your computer and use it in GitHub Desktop.
This gist has been created from CodeCred.me
var damageThisRound = Math.floor(Math.random() * 5 + 1);
var slaying = true;
var youHit = Math.floor(Math.random() + 0.5);
var totalDamage = 0;
while (slaying) {
if (youHit === true){
console.log("You hit the dragon!");
} else {
console.log("You've been hit by the dragon! That's going to sting");
}
slaying = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment