Skip to content

Instantly share code, notes, and snippets.

@antoinefortin
Created March 21, 2018 14:25
Show Gist options
  • Save antoinefortin/992e1eb85848e771c2dffa243481b4ed to your computer and use it in GitHub Desktop.
Save antoinefortin/992e1eb85848e771c2dffa243481b4ed to your computer and use it in GitHub Desktop.
[Javascript Oscillate Boolean Counter]
var pi = Math.PI;
var lim = 200;
counter = 0;
for (i = 0; i++) {
if (sin(i*pi/lim) >= 0 ) {
counter ++
} else {
counter --
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment