//government start state
var governmentState=”open”;
var government= {‘congress’:{‘democrats’: 252,’republicans’: 278} , ‘president’:’democrat’};

if(government[‘congress’][‘democrats’]>government[‘congress’][‘republicans’]) congressMajority=’democrats’;
else congressMajority=’republicans’;

if(government[‘president’] != congressMajority){

//government has a 8% chance of shutdown year-to-year (19 shutdowns in 237 yr history)
//historically, a president having control of  of congress is practically a toss-up, resulting in…
randNum = Math.floor((Math.random()*4)+1);
if(randNum == 4){
governmentState=”shutdown”;
alert(“Sorry, the government is currently in “+ governmentState+” mode. Please try again.”);

}
}

Advertisements