Created
September 30, 2014 21:55
-
-
Save petershaw/d42f7943b47e59d6ff62 to your computer and use it in GitHub Desktop.
calculate power of a thing by %
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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