Skip to content

Instantly share code, notes, and snippets.

@xnimorz
Last active August 29, 2015 13:56
Show Gist options
  • Save xnimorz/8866543 to your computer and use it in GitHub Desktop.
Save xnimorz/8866543 to your computer and use it in GitHub Desktop.
var day = 0, active = 0, deactive = 1;
for (;day <= 50; day++)
{
console.log(day + " " + (active + deactive) + " " + active + " " + deactive);
if (day % 2 === 1) {
var temp = active;
active = deactive + active;
deactive = temp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment