Skip to content

Instantly share code, notes, and snippets.

@ericraio
Created October 24, 2012 00:12
Show Gist options
  • Save ericraio/3942865 to your computer and use it in GitHub Desktop.
Save ericraio/3942865 to your computer and use it in GitHub Desktop.
function calculateIraq (multiplier) {
var previouslyAllocated = 797310713001; // amount previously allocated for all prior years combined
var ratePerMS = 0.318675948653 ; // the rate per MS of the war for current fiscal year
var curDate = new Date(); // today's date
var diff = curDate - startFiscalYear; // MS between today and start of fiscal year
costOfIraq = (previouslyAllocated + (diff * ratePerMS)) * multiplier; // cost of Iraq war at this time
}
function calculateAg (multiplier) {
var previouslyAllocated = 459786487495; // amount previously allocated for all prior years combined
var ratePerMS = 3.51199622774; // the rate per MS of the war for current fiscal year
var curDate = new Date(); // today's date
var diff = curDate - startFiscalYear; // MS between today and start of fiscal year
costOfAg = (previouslyAllocated + (diff * ratePerMS)) * multiplier; // cost of Afghanistan war at this time
}
function calculateTotal () {
costOfTotal = (costOfAg + costOfIraq); // costoftotal = cost of iraq + cost of afghanistan
if (costOfTotal <= 0) {
alert ("costofwar.com uses your computers date to calculate the cost. "+
"Yours must be wrong because according to your computer the war "+
"hasn't even started yet!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment