User:Killr833/monopoly.js

/* I'm making a non-flash version of the classic game */

// Array Remove - By John Resig (MIT Licensed) Array.prototype.remove = function(from, to) { var rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; return this.push.apply(this, rest); };

function dieRoll { // Random number between 1 and 6 var dieResult = Math.ceil(Math.random*6); return dieResult; }

function shuffleChance { var choices = [			'advToGo', 'bankDividend', 'advanceRailroad1', 'advanceRailroad2', 'advanceBoardwalk', 'poorTax', 'back3', 'loanMatures', 'advanceReading', 'advanceCharles', 'outJail', 'generalRepairs', 'advanceIllinois', 'electedChairman', 'advanceUtility', 'toJail' ]	var choice1 = Math.floor(Math.random*14); var card1 = choices[choice1]; choices.remove(choice1); var choice2 = Math.floor(Math.random*13); var card2 = choices[choice2]; choices.remove(choice2); var choice3 = Math.floor(Math.random*12); var card3 = choices[choice3]; choices.remove(choice3); var choice4 = Math.floor(Math.random*11); var card4 = choices[choice4]; choices.remove(choice4); var choice5 = Math.floor(Math.random*10); var card5 = choices[choice5]; choices.remove(choice5); var choice6 = Math.floor(Math.random*9); var card6 = choices[choice6]; choices.remove(choice6); var choice7 = Math.floor(Math.random*8); var card7 = choices[choice7]; choices.remove(choice8); var choice8 = Math.floor(Math.random*7); var card8 = choices[choice8]; choices.remove(choice8);