Skip to content

Instantly share code, notes, and snippets.

@huezoaa
Created March 26, 2015 03:48
Show Gist options
  • Save huezoaa/950317353045212bdda8 to your computer and use it in GitHub Desktop.
Save huezoaa/950317353045212bdda8 to your computer and use it in GitHub Desktop.
var totalGen = 19;
var totalMW = 0;
var smallMW = 62;
var largeMW = 124;
var capacity = 0;
for (var genNum = 1; genNum <= totalGen; genNum++){
if (genNum <= 4){
capacity = smallMW;
}else{
capacity = largeMW;
};
if (genNum%2 === 0){
totalMW += capacity;
console.log("Generator #" + genNum +" is on, adding " + capacity + " MW, for a total of " + totalMW + " MW!");
}else{
console.log("Generator #" + genNum + " is off.");
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment