Skip to content

Instantly share code, notes, and snippets.

@petershaw
Created September 30, 2014 21:55
Show Gist options
  • Save petershaw/d42f7943b47e59d6ff62 to your computer and use it in GitHub Desktop.
Save petershaw/d42f7943b47e59d6ff62 to your computer and use it in GitHub Desktop.
calculate power of a thing by %
var power = 80;
var state = 1;
for(turn=0;turn<100;turn++){
if((turn % power) > 0){
if(state){console.log(". ", turn);} else {console.log("ON", turn);}
} else {
state--;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment