Skip to content

Instantly share code, notes, and snippets.

@huezoaa
Created Mar 26, 2015
Embed
What would you like to do?
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