diff --git a/BeatThat.js b/BeatThat.js
new file mode 100644
index 00000000..a5ac929b
--- /dev/null
+++ b/BeatThat.js
@@ -0,0 +1,1117 @@
+//Flow for Game Control
+var GAMESTATEONE = "GAME_PROCESS_STATE_ONE";
+var GAMESTATETWO = "GAME_PROCESS_STATE_TWO";
+var GAMESTATETHREE = "GAME_PROCESS_STATE_THREE";
+var GAMESTATEFOUR = "GAME_PROCESS_STATE_FOUR";
+var GAMESTATEFIVE = "GAME_PROCESS_STATE_FIVE";
+var GAMESTATESIX = "GAME_PROCESS_STATE_SIX";
+var gameProcessState = GAMESTATEONE;
+
+//Type of Game
+var PLAYMODE = "";
+var BEATthatScoreMode = "Beat that Score Game MODE";
+var LOWESTComboNumberMode = "Lowest Combination Number Game MODE";
+var VARIABLENumberofDiceMode = "Variable Number of Dice MODE";
+
+//User Choice
+var MAINUserChoice = "";
+
+//Common use
+var BREAKONELINES = "
";
+var BREAKTWOLINES = BREAKONELINES + BREAKONELINES;
+var BREAKTHREELINES = BREAKTWOLINES + BREAKONELINES;
+
+//Display screen
+var WELCOMEEMPTYStatmentMSGOne =
+ "Hey~! It's alright... We don't bite πββοΈ!
Please input your name to start game.";
+var BEATthatScoreMSG =
+ "Two players will roll two dice." +
+ BREAKONELINES +
+ "The score is the running sum of all numbers that player has generated so far.";
+var LOWESTComboNumberMSG =
+ "Player will need to choice the lowest combined number from dice rolls. " +
+ BREAKONELINES +
+ "For example, for dice rolls [6, 3] in Lowest Combined Number mode, player should generate the lowest combo of number 36.";
+var VARIABLENumberofDiceMSG =
+ "You are allow to choose the amount of dice to throw" +
+ BREAKONELINES +
+ "The score is the running sum of all numbers that player has generated so far.";
+var GAMEMenuMSG =
+ "There are 2 modes of game:" +
+ BREAKTWOLINES +
+ "#1 : Beat That Score" +
+ BREAKONELINES +
+ BEATthatScoreMSG +
+ BREAKTWOLINES +
+ "#2 : Lowest Combo" +
+ BREAKONELINES +
+ LOWESTComboNumberMSG +
+ BREAKTWOLINES +
+ "#3 : Variable Number of Dice" +
+ BREAKONELINES +
+ VARIABLENumberofDiceMSG;
+
+//BEAT THAT: Gamemode 1 variable
+var GAMEMODEBEATTHATUserdiceroll = [];
+var GAMEMODEBEATTHATUserdicerollSum = 0;
+var GAMEMODEBEATTHATUserOverallSUM = 0;
+var GAMEMODEBEATTHATCommdiceroll = [];
+var GAMEMODEBEATTHATCommdicerollSum = 0;
+var GAMEMODEBEATTHATCommOverallSUM = 0;
+var GAMEMODEBEATTHATCount = 1;
+var GAMEMODEBEATTHATnoOfdiceroll = 2;
+var GAMEMODEBEATTHATMODEONE = "Mode One";
+var GAMEMODEBEATTHATMODETWO = "Mode Two";
+var GAMEMODEBEATTHATMODETHREE = "Mode Three";
+var GAMEMODEBEATTHATMODEFOUR = "Mode Four";
+var GAMEMODEBEATTHATMODEFIVE = "Mode Five";
+var GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODEONE;
+
+//Lowest Combination: Gamemode 2 variable
+var LOWESTCOMBOMODEUserdiceroll = [];
+var LOWESTCOMBOMODEUserdicerollSum = 0;
+var LOWESTCOMBOMODEUserOverallSUM = 0;
+var LOWESTCOMBOMODECommdiceroll = [];
+var LOWESTCOMBOMODECommdicerollSum = 0;
+var LOWESTCOMBOMODECommOverallSUM = 0;
+var LOWESTCOMBOMODECount = 1;
+var LOWESTCOMBOMODEnoOfdiceroll = 2;
+var LOWESTCOMBOMODEMODEONE = "Mode One";
+var LOWESTCOMBOMODEMODETWO = "Mode Two";
+var LOWESTCOMBOMODEMODETHREE = "Mode Three";
+var LOWESTCOMBOMODEMODEFOUR = "Mode Four";
+var LOWESTCOMBOMODEMODEFIVE = "Mode Five";
+var LOWESTCOMBOMODE = LOWESTCOMBOMODEMODEONE;
+
+//Variable dice game mode: Gamemode 3 variable
+var GAMEMODEVARIABLENUMBEROFDICE = 0;
+var GAMEMODEVARIABLENUMBEROFDICECount = 1;
+var GAMEMODEVARIABLENUMBEROFDICEUserdiceroll = [];
+var GAMEMODEVARIABLENUMBEROFDICECommdiceroll = [];
+var GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM = 0;
+var GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM = 0;
+var GAMEMODEVARIABLENUMBEROFDICEMODEONE = "Mode One";
+var GAMEMODEVARIABLENUMBEROFDICEMODETWO = "Mode Two";
+var GAMEMODEVARIABLENUMBEROFDICEMODETHREE = "Mode Three";
+var GAMEMODEVARIABLENUMBEROFDICEMODEFOUR = "Mode Four";
+var GAMEMODEVARIABLENUMBEROFDICEMODEFIVE = "Mode Five";
+var GAMEMODEVARIABLENUMBEROFDICEMODESIX = "Mode Six";
+var GAMEMODEVARIABLENUMBEROFDICEMODESEVEN = "Mode Seven";
+var GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODEONE;
+
+var main = function (input) {
+ let statement = "";
+ switch (gameProcessState) {
+ case GAMESTATEONE:
+ statement = NAMEValidationCHECK(input);
+ break;
+ case GAMESTATETWO:
+ statement = GAMESTATERequirement(input);
+ break;
+ case GAMESTATETHREE:
+ switch (PLAYMODE) {
+ case BEATthatScoreMode:
+ statement = GAMEMODEBEATTHATMAINone(input);
+ break;
+ case LOWESTComboNumberMode:
+ statement = GAMEMODELOWESTCOMBOMAIN(input);
+ break;
+ case VARIABLENumberofDiceMode:
+ statement = GAMEMODEVARIABLENUMBEROFDICEMAIN(input);
+ break;
+ default:
+ statement = null;
+ break;
+ }
+ }
+ return statement;
+};
+
+function NAMEValidationCHECK(NameValidation) {
+ let NAMEValided = "";
+ switch (NameValidation) {
+ case "":
+ NAMEValided = WELCOMEEMPTYStatmentMSGOne;
+ break;
+ default:
+ Username = NameValidation;
+ gameProcessState = GAMESTATETWO;
+ NAMEValided =
+ "Hi " +
+ Username +
+ ", nice to meet you π! " +
+ BREAKTWOLINES +
+ GAMEMenuMSG;
+ break;
+ }
+ return NAMEValided;
+}
+
+function GAMESTATERequirement(MAINUserChoice) {
+ let GameStatment;
+ switch (MAINUserChoice) {
+ case "1":
+ GameStatment =
+ "You have selected Beat That Score Mode!" +
+ BREAKTWOLINES +
+ "You will play against JASON's personal robot π€. " +
+ BREAKTWOLINES +
+ "#1. Each one of you will take a turn to roll the dice.π²" +
+ BREAKONELINES +
+ "#2. Player will have the choice to accept the lowest combo generated automatically." +
+ BREAKONELINES +
+ "#3. The lowest combination number will win the round of game." +
+ BREAKONELINES +
+ "#4. Scores will continue until you exit this game mode (β_β;)" +
+ BREAKONELINES +
+ "#5. Once exit, score will automaticatically restart from 0οΈβ£." +
+ BREAKTWOLINES +
+ "Click the submit to start the game π€";
+ gameProcessState = GAMESTATETHREE;
+ PLAYMODE = BEATthatScoreMode;
+ break;
+ case "2":
+ GameStatment =
+ "You have selected Lowest Combo mode!" +
+ BREAKTWOLINES +
+ "You will play against JASON's personal robot π€. " +
+ BREAKTWOLINES +
+ "#1. Each one of you will take a turn to roll the dice. π²" +
+ BREAKONELINES +
+ "#2. Players are able to choose the lowest combination.π" +
+ BREAKONELINES +
+ "#3. Game will continue until you exit (β_β;)" +
+ BREAKONELINES +
+ "#4. Once exit, score will automaticatically restart from 0οΈβ£" +
+ BREAKONELINES +
+ "#5. There is no permanent winner, but a temporary leader." +
+ BREAKTWOLINES +
+ "Click the submit to start the game π€";
+ gameProcessState = GAMESTATETHREE;
+ PLAYMODE = LOWESTComboNumberMode;
+ break;
+ case "3":
+ GameStatment =
+ "You have selected Variable Number of Dice Mode!" +
+ BREAKTWOLINES +
+ "You will play against JASON's personal robot π€. " +
+ BREAKTWOLINES +
+ "#1. You have to ability to choose the number of dice" +
+ BREAKONELINES +
+ "#2. Each one of you will take a turn to roll the dice. π²" +
+ BREAKONELINES +
+ "#3. Players with the lowest sum will win the match!π" +
+ BREAKONELINES +
+ "#4. Game will continue until you exit (β_β;)" +
+ BREAKONELINES +
+ "#5. Once exit, score will automaticatically restart from 0οΈβ£" +
+ BREAKONELINES +
+ "#6. There is no permanent winner, but a temporary leader." +
+ BREAKTWOLINES +
+ "Click the submit to start the game π€";
+ gameProcessState = GAMESTATETHREE;
+ PLAYMODE = VARIABLENumberofDiceMode;
+ break;
+ default:
+ GameStatment =
+ "Hey " +
+ Username +
+ "." +
+ BREAKONELINES +
+ "You entered an invalid choice.π€" +
+ BREAKONELINES +
+ GAMEMenuMSG;
+ }
+ return GameStatment;
+}
+
+function diceROLL() {
+ return Math.floor(Math.random() * 6) + 1;
+}
+
+function GAMEMODEBEATTHATMAINone(GAMEMODESEConeCHOICE) {
+ let GAMEMODESEConeMSG = "";
+ let GAMEMODESEConeCHOICES = GAMEMODESEConeCHOICE.trim().toUpperCase();
+ switch (GAMEMODESEConeCHOICES) {
+ case "":
+ switch (GAMEMODEBEATTHATMODE) {
+ case GAMEMODEBEATTHATMODEONE:
+ GAMEMODESEConeMSG = GAMEMODEBEATTHATSECTIONuserturn();
+ break;
+ case GAMEMODEBEATTHATMODETWO:
+ GAMEMODESEConeMSG = GAMEMODEBEATTHATSECTIONCommturn();
+ break;
+ case GAMEMODEBEATTHATMODETHREE:
+ GAMEMODESEConeMSG = GAMEMODEBEATTHATSECTIONscoring();
+ break;
+ case GAMEMODEBEATTHATMODEFOUR:
+ GAMEMODESEConeMSG = GAMEMODEBEATTHATSECTIONPlayAgain();
+ break;
+ case GAMEMODEBEATTHATMODEFIVE:
+ GAMEMODESEConeMSG = GAMEMODEBEATTHATMODEDECISION(null);
+ break;
+ }
+ break;
+ case "EXIT":
+ GAMEMODESEConeMSG = GAMEMODEBEATTHATMODEDECISION("EXIT");
+ break;
+ case "QUIT":
+ location.reload();
+ break;
+ default:
+ GAMEMODESEConeMSG = ILLEGALKEYINTERRUPT();
+ break;
+ }
+ return GAMEMODESEConeMSG;
+}
+
+function GAMEMODEBEATTHATMODEDECISION(GAMEMODEBEATTHATDECISIONMODE) {
+ MODEDecisionMSG = "";
+ if (GAMEMODEBEATTHATDECISIONMODE == "EXIT") {
+ GAMEMODEBEATTHATUserdiceroll = [];
+ GAMEMODEBEATTHATUserdicerollSum = 0;
+ GAMEMODEBEATTHATUserOverallSUM = 0;
+ GAMEMODEBEATTHATCommdiceroll = [];
+ GAMEMODEBEATTHATCommdicerollSum = 0;
+ GAMEMODEBEATTHATCommOverallSUM = 0;
+ GAMEMODEBEATTHATCount = 1;
+ GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODEONE;
+ PLAYMODE = "";
+ gameProcessState = GAMESTATETWO;
+ MODEDecisionMSG = GAMEMenuMSG;
+ //location.reload();
+ } else {
+ GAMEMODEBEATTHATCount++;
+ GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODEONE;
+ MODEDecisionMSG = GAMEMODEBEATTHATSECTIONuserturn();
+ }
+ return MODEDecisionMSG;
+}
+
+function ILLEGALKEYINTERRUPT() {
+ return (
+ "Hey " +
+ Username +
+ ", did you enter an unacceptable key? π
Click submit button to continue where you left off."
+ );
+}
+
+function GAMEMODEBEATTHATSECTIONuserturn() {
+ let GAMEMODEBEATTHATSECTIONoneMSG = "";
+ let GAMEMODEBEATTHATSECTIONoneUsertmp = GAMEMODEBEATTHATSECTIONoneRoll();
+ GAMEMODEBEATTHATUserdicerollSum = GlobalShareSUMUPArray(
+ GAMEMODEBEATTHATSECTIONoneUsertmp
+ );
+ GAMEMODEBEATTHATUserdiceroll.push(GAMEMODEBEATTHATUserdicerollSum);
+ GAMEMODEBEATTHATUserOverallSUM = GlobalShareSUMUPArray(
+ GAMEMODEBEATTHATUserdiceroll
+ );
+ ////////////////////////////////////////////////////////
+ // console.log("GAMEMODEBEATTHATSECTIONoneUsertmp");
+ // console.log(GAMEMODEBEATTHATSECTIONoneUsertmp);
+ // console.log("GAMEMODEBEATTHATUserdicerollSum");
+ // console.log(GAMEMODEBEATTHATUserdicerollSum);
+ console.log("GAMEMODEBEATTHATUserdiceroll");
+ console.log(GAMEMODEBEATTHATUserdiceroll);
+ console.log("GAMEMODEBEATTHATUserOverallSUM");
+ console.log(GAMEMODEBEATTHATUserOverallSUM);
+ ////////////////////////////////////////////////////////
+ GAMEMODEBEATTHATSECTIONoneMSG =
+ "" +
+ BEATthatScoreMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEBEATTHATCount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ " had roll: " +
+ BREAKTWOLINES +
+ GAMEMODEBEATTHATSECTIONoneUsertmp[0] +
+ " for the first dices π² and " +
+ BREAKONELINES +
+ GAMEMODEBEATTHATSECTIONoneUsertmp[1] +
+ " for the second dice π²" +
+ "." +
+ BREAKTWOLINES +
+ "Total sum of: " +
+ GAMEMODEBEATTHATUserdicerollSum;
+ //GAMEMODEBEATTHATSECTIONoneUsertmp = [];
+ GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODETWO;
+ return GAMEMODEBEATTHATSECTIONoneMSG;
+}
+
+function GAMEMODEBEATTHATSECTIONCommturn() {
+ let GAMEMODEBEATTHATSECTIONoneMSG = "";
+ let GAMEMODEBEATTHATSECTIONoneCommtmp = GAMEMODEBEATTHATSECTIONoneRoll();
+ GAMEMODEBEATTHATCommdicerollSum = GlobalShareSUMUPArray(
+ GAMEMODEBEATTHATSECTIONoneCommtmp
+ );
+ GAMEMODEBEATTHATCommdiceroll.push(GAMEMODEBEATTHATCommdicerollSum);
+ GAMEMODEBEATTHATCommOverallSUM = GlobalShareSUMUPArray(
+ GAMEMODEBEATTHATCommdiceroll
+ );
+ ////////////////////////////////////////////////////////
+ // console.log("GAMEMODEBEATTHATSECTIONoneCommtmp");
+ // console.log(GAMEMODEBEATTHATSECTIONoneCommtmp);
+ // console.log("GAMEMODEBEATTHATCommdicerollSum");
+ // console.log(GAMEMODEBEATTHATCommdiceroll);
+ console.log("GAMEMODEBEATTHATCommdiceroll");
+ console.log(GAMEMODEBEATTHATCommdiceroll);
+ console.log("GAMEMODEBEATTHATCommOverallSUM");
+ console.log(GAMEMODEBEATTHATCommOverallSUM);
+ ////////////////////////////////////////////////////////
+ GAMEMODEBEATTHATSECTIONoneMSG =
+ "" +
+ BEATthatScoreMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEBEATTHATCount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's robo" +
+ " had roll: " +
+ BREAKTWOLINES +
+ GAMEMODEBEATTHATSECTIONoneCommtmp[0] +
+ " for the first dices π² and " +
+ BREAKONELINES +
+ GAMEMODEBEATTHATSECTIONoneCommtmp[1] +
+ " for the second dice π² " +
+ "." +
+ BREAKTWOLINES +
+ "Total sum of: " +
+ GAMEMODEBEATTHATCommdicerollSum;
+ GAMEMODEBEATTHATSECTIONoneCommtmp = [];
+ GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODETHREE;
+ return GAMEMODEBEATTHATSECTIONoneMSG;
+}
+
+function GAMEMODEBEATTHATSECTIONscoring() {
+ let GAMEMODEBEATTHATSECTIONscoringMSG;
+ if (GAMEMODEBEATTHATUserOverallSUM > GAMEMODEBEATTHATCommOverallSUM) {
+ GAMEMODEBEATTHATSECTIONscoringMSG =
+ "" +
+ BEATthatScoreMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEBEATTHATCount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ GAMEMODEBEATTHATUserOverallSUM +
+ BREAKTWOLINES +
+ "JASON's bot had an overall score of " +
+ GAMEMODEBEATTHATCommOverallSUM +
+ BREAKTWOLINES +
+ "You had beat JASON's bot!π²" +
+ BREAKTWOLINES +
+ "Winner: " +
+ Username +
+ "";
+ } else if (GAMEMODEBEATTHATUserOverallSUM < GAMEMODEBEATTHATCommOverallSUM) {
+ GAMEMODEBEATTHATSECTIONscoringMSG =
+ "" +
+ BEATthatScoreMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEBEATTHATCount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's bot an overall score of " +
+ GAMEMODEBEATTHATCommOverallSUM +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ GAMEMODEBEATTHATUserOverallSUM +
+ BREAKTWOLINES +
+ "Come on, let's go another round!π" +
+ BREAKTWOLINES +
+ "Winner: JASON's Bots π€ ";
+ } else {
+ GAMEMODEBEATTHATSECTIONscoringMSG =
+ "" +
+ BEATthatScoreMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEBEATTHATCount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's bot an overall score of " +
+ GAMEMODEBEATTHATCommOverallSUM +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ GAMEMODEBEATTHATUserOverallSUM +
+ BREAKTWOLINES +
+ "Come on, let's go another round!π" +
+ BREAKTWOLINES +
+ "Winner: Draw Match π€";
+ }
+ GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODEFOUR;
+ return GAMEMODEBEATTHATSECTIONscoringMSG;
+}
+
+function GAMEMODEBEATTHATSECTIONPlayAgain() {
+ let PLayAgainMSG;
+ PLayAgainMSG =
+ "" +
+ BEATthatScoreMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEBEATTHATCount +
+ "" +
+ " had ended" +
+ BREAKTWOLINES +
+ "#1: Click submit button for the next round to continue playing. " +
+ BREAKTWOLINES +
+ '#2: Enter "EXIT" in the textbox. To exit "Beat that Mode" ' +
+ BREAKTWOLINES +
+ '#3: Enter "QUIT" into the textbox. To quit game mode';
+ GAMEMODEBEATTHATMODE = GAMEMODEBEATTHATMODEFIVE;
+ return PLayAgainMSG;
+}
+
+function GAMEMODEBEATTHATSECTIONoneRoll() {
+ let GAMEMODEBEATTHATdicerolltemp = [];
+ for (var i = 1; i <= GAMEMODEBEATTHATnoOfdiceroll; i++) {
+ GAMEMODEBEATTHATdicerolltemp.push(diceROLL());
+ }
+ return GAMEMODEBEATTHATdicerolltemp;
+}
+
+function GlobalShareSUMUPArray(TotalNum) {
+ let tempsum = 0;
+ for (var i = 0; i < TotalNum.length; i++) {
+ tempsum += TotalNum[i];
+ }
+ return tempsum;
+}
+
+function GAMEMODELOWESTCOMBOMAIN(GAMEMODELOWESTCOMBOChoice) {
+ let GAMEMODELOWESTCOMBOMAINMSG = "";
+ let GAMEMODELOWESTCOMBOMAINCHOICES =
+ GAMEMODELOWESTCOMBOChoice.trim().toUpperCase();
+ switch (GAMEMODELOWESTCOMBOMAINCHOICES) {
+ case "":
+ switch (LOWESTCOMBOMODE) {
+ case LOWESTCOMBOMODEMODEONE:
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEuserturn(false);
+ break;
+ case LOWESTCOMBOMODEMODETWO:
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEcommturn();
+ break;
+ case LOWESTCOMBOMODEMODETHREE:
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEDeclareWinner();
+ break;
+ case LOWESTCOMBOMODEMODEFOUR:
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEPlayAgain();
+ break;
+ case LOWESTCOMBOMODEMODEFIVE:
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEPlayerDecision(null);
+ break;
+ }
+ break;
+ case "1":
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEuserDecONE();
+ break;
+ case "2":
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEuserDecTWo();
+ break;
+ case "3":
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEuserturn(true);
+ break;
+ case "EXIT":
+ GAMEMODELOWESTCOMBOMAINMSG = LOWESTCOMBOMODEPlayerDecision("EXIT");
+ break;
+ default:
+ GAMEMODELOWESTCOMBOMAINMSG = ILLEGALKEYINTERRUPT();
+ break;
+ }
+ return GAMEMODELOWESTCOMBOMAINMSG;
+}
+
+function LOWESTCOMBOMODEuserturn(USERRequestRoll) {
+ let LOWESTCOMBOMODEuserMSG = "";
+ if (USERRequestRoll == false) {
+ LOWESTCOMBOMODERoll();
+ ////////////////////////////////////////////////////////
+ // console.log("LOWESTCOMBOSECTIONoneUsertmp");
+ // console.log(LOWESTCOMBOSECTIONoneUsertmp);
+ // console.log("LOWESTCOMBOUserdicerollSum");
+ // console.log(LOWESTCOMBOUserdicerollSum);
+ console.log("LOWESTCOMBOMODEUserdiceroll 1");
+ console.log(LOWESTCOMBOMODEUserdiceroll[0]);
+ console.log("LOWESTCOMBOMODEUserdiceroll 2");
+ console.log(LOWESTCOMBOMODEUserdiceroll[1]);
+ ////////////////////////////////////////////////////////
+ LOWESTCOMBOMODEuserMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ " had roll: " +
+ BREAKTWOLINES +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ " for the first dices π² and " +
+ BREAKONELINES +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ " for the second dice π²" +
+ "." +
+ BREAKTWOLINES +
+ '#1 : Type "1" into the textbox to choose ' +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ " , " +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ " β‘ " +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ BREAKONELINES +
+ '#2 : Type "2" into the textbox to choose ' +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ " , " +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ " β‘ " +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ BREAKTWOLINES +
+ '#3 : OR..... If you wish to roll again, enter "3" in the textboxπ€' +
+ BREAKTHREELINES +
+ "Be reminded that the lowest combination wins~ π€";
+ } else if (USERRequestRoll == true) {
+ LOWESTCOMBOMODEUserdiceroll = [];
+ LOWESTCOMBOMODERoll();
+ ////////////////////////////////////////////////////////
+ // console.log("LOWESTCOMBOSECTIONoneUsertmp");
+ // console.log(LOWESTCOMBOSECTIONoneUsertmp);
+ // console.log("LOWESTCOMBOUserdicerollSum");
+ // console.log(LOWESTCOMBOUserdicerollSum);
+ console.log("LOWESTCOMBOMODEUserdiceroll 1");
+ console.log(LOWESTCOMBOMODEUserdiceroll[0]);
+ console.log("LOWESTCOMBOMODEUserdiceroll 2");
+ console.log(LOWESTCOMBOMODEUserdiceroll[1]);
+ ////////////////////////////////////////////////////////
+ LOWESTCOMBOMODEuserMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ " had roll: " +
+ BREAKTWOLINES +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ " for the first dices π² and " +
+ BREAKONELINES +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ " for the second dice π²" +
+ "." +
+ BREAKTWOLINES +
+ '#1 : Type "1" into the textbox to choose ' +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ " , " +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ " β‘ " +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ BREAKONELINES +
+ '#2 : Type "2" into the textbox to choose ' +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ " , " +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ " β‘ " +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ BREAKTHREELINES +
+ "Be remindered that the lowest combination wins~ π€" +
+ BREAKTWOLINES +
+ 'OR..... If you wish to roll again, enter "Roll again" in the textboxπ€';
+ }
+ return LOWESTCOMBOMODEuserMSG;
+}
+
+function LOWESTCOMBOMODEuserDecONE() {
+ let LOWESTCOMBOMODEuserDecONEMSG;
+ LOWESTCOMBOMODEUserdicerollSum = parseInt(
+ LOWESTCOMBOMODEUserdiceroll[0] + LOWESTCOMBOMODEUserdiceroll[1]
+ );
+ LOWESTCOMBOMODEuserDecONEMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ ": You had choosen combination of " +
+ +LOWESTCOMBOMODEUserdiceroll[0] +
+ " , " +
+ LOWESTCOMBOMODEUserdiceroll[1] +
+ BREAKTWOLINES +
+ " β‘ " +
+ LOWESTCOMBOMODEUserdicerollSum +
+ BREAKTWOLINES +
+ "There is no returning now Β―\\_(γ)_/Β―" +
+ BREAKONELINES +
+ "Click the submit to start the game π€";
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODETWO;
+ return LOWESTCOMBOMODEuserDecONEMSG;
+}
+
+function LOWESTCOMBOMODEuserDecTWo() {
+ let LOWESTCOMBOMODEuserDecTWOMSG;
+ LOWESTCOMBOMODEUserdicerollSum = parseInt(
+ LOWESTCOMBOMODEUserdiceroll[1] + LOWESTCOMBOMODEUserdiceroll[0]
+ );
+ LOWESTCOMBOMODEuserDecTWOMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ ": You had choosen combination of " +
+ +LOWESTCOMBOMODEUserdiceroll[1] +
+ " , " +
+ LOWESTCOMBOMODEUserdiceroll[0] +
+ BREAKTWOLINES +
+ " β‘ " +
+ LOWESTCOMBOMODEUserdicerollSum +
+ BREAKTWOLINES +
+ "There is no returning now Β―\\_(γ)_/Β―" +
+ BREAKONELINES +
+ "Click the submit to start the game π€";
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODETWO;
+ return LOWESTCOMBOMODEuserDecTWOMSG;
+}
+
+function LOWESTCOMBOMODEcommturn() {
+ let LOWESTCOMBOMODEcommMSG = "";
+ LOWESTCOMBOMODECommRoll();
+ LOWESTCOMBOMODECommdicerollSum = parseInt(
+ LOWESTCOMBOMODECommdiceroll[0] + LOWESTCOMBOMODECommdiceroll[1]
+ );
+ ////////////////////////////////////////////////////////
+ // console.log("LOWESTCOMBOSECTIONoneUsertmp");
+ // console.log(LOWESTCOMBOSECTIONoneUsertmp);
+ // console.log("LOWESTCOMBOUserdicerollSum");
+ // console.log(LOWESTCOMBOUserdicerollSum);
+ console.log("LOWESTCOMBOMODECommdiceroll 1");
+ console.log(LOWESTCOMBOMODECommdiceroll[0]);
+ console.log("LOWESTCOMBOMODECommdiceroll 2");
+ console.log(LOWESTCOMBOMODECommdiceroll[1]);
+ ////////////////////////////////////////////////////////
+ LOWESTCOMBOMODEcommMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's personal robotπ€" +
+ " had roll: " +
+ BREAKTWOLINES +
+ LOWESTCOMBOMODECommdiceroll[0] +
+ " for the first dices π² and " +
+ BREAKONELINES +
+ LOWESTCOMBOMODECommdiceroll[1] +
+ " for the second dice π²" +
+ BREAKTWOLINES +
+ "With a combination of " +
+ LOWESTCOMBOMODECommdicerollSum;
+ //LOWESTCOMBOSECTIONoneUsertmp = [];
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODETHREE;
+ return LOWESTCOMBOMODEcommMSG;
+}
+
+function LOWESTCOMBOMODEDeclareWinner() {
+ let LOWESTCOMBOMODEDeclareWinnerMSG;
+ if (LOWESTCOMBOMODEUserdicerollSum < LOWESTCOMBOMODECommdicerollSum) {
+ LOWESTCOMBOMODEDeclareWinnerMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ " had an overall sum of " +
+ LOWESTCOMBOMODEUserdicerollSum +
+ BREAKTWOLINES +
+ "JASON's bot had an overall score of " +
+ LOWESTCOMBOMODECommdicerollSum +
+ BREAKTWOLINES +
+ "You had beat JASON's bot!π²" +
+ BREAKTWOLINES +
+ "Winner: " +
+ Username +
+ "";
+ } else {
+ LOWESTCOMBOMODEDeclareWinnerMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's bot an overall score of " +
+ LOWESTCOMBOMODECommdicerollSum +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ LOWESTCOMBOMODEUserdicerollSum +
+ BREAKTWOLINES +
+ "Come on, let's go another round!π" +
+ BREAKTWOLINES +
+ "Winner: JASON's Bots π€ ";
+ }
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODEFOUR;
+ return LOWESTCOMBOMODEDeclareWinnerMSG;
+}
+
+function LOWESTCOMBOMODEPlayAgain() {
+ let LOWESTCOMBOMODEPlayAgainMSG =
+ "Round " +
+ LOWESTCOMBOMODECount +
+ "" +
+ " had ended" +
+ BREAKTWOLINES +
+ "#1: Click submit button for the next round to continue playing. " +
+ BREAKTWOLINES +
+ '#2: Enter "EXIT" in the textbox. To exit "Beat that Mode" ' +
+ BREAKTWOLINES +
+ '#3: Enter "QUIT" into the textbox. To quit game mode';
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODEFIVE;
+ return LOWESTCOMBOMODEPlayAgainMSG;
+}
+
+function LOWESTCOMBOMODEPlayerDecision(PLayerDecisionMade) {
+ let LOWESTCOMBOMODEPlayerDecisionMSG;
+ if (PLayerDecisionMade == "EXIT") {
+ LOWESTCOMBOMODEUserdiceroll = [];
+ LOWESTCOMBOMODEUserdicerollSum = 0;
+ LOWESTCOMBOMODEUserOverallSUM = 0;
+ LOWESTCOMBOMODECommdiceroll = [];
+ LOWESTCOMBOMODECommdicerollSum = 0;
+ LOWESTCOMBOMODECommOverallSUM = 0;
+ LOWESTCOMBOMODECount = 1;
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODEONE;
+ PLAYMODE = "";
+ gameProcessState = GAMESTATETWO;
+ LOWESTCOMBOMODEPlayerDecisionMSG = GAMEMenuMSG;
+ } else {
+ LOWESTCOMBOMODECount++;
+ LOWESTCOMBOMODEUserdiceroll = [];
+ LOWESTCOMBOMODECommdiceroll = [];
+ LOWESTCOMBOMODE = LOWESTCOMBOMODEMODEONE;
+ LOWESTCOMBOMODEPlayerDecisionMSG = LOWESTCOMBOMODEuserturn(false);
+ }
+ return LOWESTCOMBOMODEPlayerDecisionMSG;
+}
+
+function LOWESTCOMBOMODERoll() {
+ for (var i = 1; i <= LOWESTCOMBOMODEnoOfdiceroll; i++) {
+ LOWESTCOMBOMODEUserdiceroll.push(diceROLL().toString());
+ }
+ return null;
+}
+
+function LOWESTCOMBOMODECommRoll() {
+ for (var i = 1; i <= LOWESTCOMBOMODEnoOfdiceroll; i++) {
+ LOWESTCOMBOMODECommdiceroll.push(diceROLL().toString());
+ }
+ LOWESTCOMBOMODECommdiceroll.sort(function (a, b) {
+ return a - b;
+ });
+ return null;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMAIN(GAMEMODEVARIABLENUMBEROFDICECHOICE) {
+ let GAMEMODEVARIABLENUMBEROFDICEMSG = "";
+ let GAMEMODEVARIABLENUMBEROFDICECHOICES =
+ GAMEMODEVARIABLENUMBEROFDICECHOICE.trim().toUpperCase();
+ switch (GAMEMODEVARIABLENUMBEROFDICECHOICES) {
+ case "":
+ switch (GAMEMODEVARIABLENUMBEROFDICEMODE) {
+ case GAMEMODEVARIABLENUMBEROFDICEMODEONE:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODEone();
+ break;
+ case GAMEMODEVARIABLENUMBEROFDICEMODETWO:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODETWOValidation(null);
+ break;
+ case GAMEMODEVARIABLENUMBEROFDICEMODETHREE:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODEUserThrowDice();
+ break;
+ case GAMEMODEVARIABLENUMBEROFDICEMODEFOUR:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODECommThrowDice();
+ break;
+ case GAMEMODEVARIABLENUMBEROFDICEMODEFIVE:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODEScoring();
+ break;
+ case GAMEMODEVARIABLENUMBEROFDICEMODESIX:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODEPlayAgain();
+ break;
+ case GAMEMODEVARIABLENUMBEROFDICEMODESEVEN:
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEDECISION(null);
+ break;
+ }
+ break;
+ case "EXIT":
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEDECISION("EXIT");
+ break;
+ case "QUIT":
+ location.reload();
+ break;
+ default:
+ if (
+ GAMEMODEVARIABLENUMBEROFDICEMODE == GAMEMODEVARIABLENUMBEROFDICEMODETWO
+ ) {
+ GAMEMODEVARIABLENUMBEROFDICEMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODETWOValidation(
+ GAMEMODEVARIABLENUMBEROFDICECHOICES
+ );
+ }
+ break;
+ }
+ return GAMEMODEVARIABLENUMBEROFDICEMSG;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODEone() {
+ let GAMEMODEVARIABLENUMBEROFDICEMODEoneMSG;
+ GAMEMODEVARIABLENUMBEROFDICEMODEoneMSG =
+ GAMEMODEVARIABLENUMBEROFDICEMODEoneMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ "Hi " +
+ Username +
+ ", please enter the number of dice!";
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODETWO;
+ return GAMEMODEVARIABLENUMBEROFDICEMODEoneMSG;
+}
+
+function GAMEMODEVARIABLESelectNUMBEROFDICE() {
+ let GAMEMODEVARIABLESelectNUMBEROFDICE;
+ GAMEMODEVARIABLESelectNUMBEROFDICE =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ "You have entered " +
+ GAMEMODEVARIABLENUMBEROFDICE +
+ " amount of dice." +
+ BREAKTWOLINES +
+ "Click the submit button to continue π€";
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODETHREE;
+ return GAMEMODEVARIABLESelectNUMBEROFDICE;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODEThrowDiceUser() {
+ for (let i = 1; i <= GAMEMODEVARIABLENUMBEROFDICE; i++) {
+ GAMEMODEVARIABLENUMBEROFDICEUserdiceroll.push(diceROLL());
+ }
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODEThrowDiceComm() {
+ for (let i = 1; i <= GAMEMODEVARIABLENUMBEROFDICE; i++) {
+ GAMEMODEVARIABLENUMBEROFDICECommdiceroll.push(diceROLL());
+ }
+}
+function GAMEMODEVARIABLENUMBEROFDICEMODEUserThrowDice() {
+ let GAMEMODEVARIABLENUMBEROFDICEMODEUserThrowDiceMSG;
+ GAMEMODEVARIABLENUMBEROFDICEMODEThrowDiceUser();
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM = GlobalShareSUMUPArray(
+ GAMEMODEVARIABLENUMBEROFDICEUserdiceroll
+ );
+ GAMEMODEVARIABLENUMBEROFDICEMODEUserThrowDiceMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ "You had rolled: " +
+ GAMEMODEVARIABLENUMBEROFDICEUserdiceroll +
+ ". With a total sum of " +
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM;
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODEFOUR;
+ return GAMEMODEVARIABLENUMBEROFDICEMODEUserThrowDiceMSG;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODECommThrowDice() {
+ let GGAMEMODEVARIABLENUMBEROFDICEMODECommThrowMSG;
+ GAMEMODEVARIABLENUMBEROFDICEMODEThrowDiceComm();
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM = GlobalShareSUMUPArray(
+ GAMEMODEVARIABLENUMBEROFDICECommdiceroll
+ );
+ GGAMEMODEVARIABLENUMBEROFDICEMODECommThrowMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ "Bot's had rolled: " +
+ GAMEMODEVARIABLENUMBEROFDICECommdiceroll +
+ ". With a total sum of " +
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM;
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODEFIVE;
+ return GGAMEMODEVARIABLENUMBEROFDICEMODECommThrowMSG;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODETWOValidation(NUMBEROFDICEMODE) {
+ let GAMEMODEVARIABLENUMBEROFDICEMODETWOValidationMSG;
+ GAMEMODEVARIABLENUMBEROFDICE = parseInt(NUMBEROFDICEMODE);
+ if (Number.isInteger(GAMEMODEVARIABLENUMBEROFDICE) == true) {
+ GAMEMODEVARIABLENUMBEROFDICEMODETWOValidationMSG =
+ GAMEMODEVARIABLESelectNUMBEROFDICE();
+ } else {
+ GAMEMODEVARIABLENUMBEROFDICEMODETWOValidationMSG =
+ ILLEGALKEYINTERRUPT() +
+ BREAKTWOLINES +
+ GAMEMODEVARIABLENUMBEROFDICEMODEone();
+ }
+ return GAMEMODEVARIABLENUMBEROFDICEMODETWOValidationMSG;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODEScoring() {
+ let GAMEMODEVARIABLENUMBEROFDICEMODEScoringMSG;
+ if (
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM >
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM
+ ) {
+ GAMEMODEVARIABLENUMBEROFDICEMODEScoringMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM +
+ BREAKTWOLINES +
+ "JASON's bot had an overall score of " +
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM +
+ BREAKTWOLINES +
+ "You had beat JASON's bot!π²" +
+ BREAKTWOLINES +
+ "Winner: " +
+ Username +
+ "";
+ } else if (
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM <
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM
+ ) {
+ GAMEMODEVARIABLENUMBEROFDICEMODEScoringMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's bot an overall score of " +
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM +
+ BREAKTWOLINES +
+ "Come on, let's go another round!π" +
+ BREAKTWOLINES +
+ "Winner: JASON's Bots π€ ";
+ } else {
+ GAMEMODEVARIABLENUMBEROFDICEMODEScoringMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKTWOLINES +
+ "JASON's bot an overall score of " +
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM +
+ BREAKTWOLINES +
+ Username +
+ " had an overall score of " +
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM +
+ BREAKTWOLINES +
+ "Come on, let's go another round!π" +
+ BREAKTWOLINES +
+ "Winner: Draw Match π€";
+ }
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODESIX;
+ return GAMEMODEVARIABLENUMBEROFDICEMODEScoringMSG;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEMODEPlayAgain() {
+ let PLayAgainMSG;
+ PLayAgainMSG =
+ "" +
+ VARIABLENumberofDiceMode +
+ "" +
+ BREAKTWOLINES +
+ ": Round " +
+ GAMEMODEVARIABLENUMBEROFDICECount +
+ "" +
+ BREAKONELINES +
+ " had ended" +
+ BREAKTWOLINES +
+ "#1: Click submit button for the next round to continue playing. " +
+ BREAKTWOLINES +
+ '#2: Enter "EXIT" in the textbox. To exit "Beat that Mode" ' +
+ BREAKTWOLINES +
+ '#3: Enter "QUIT" into the textbox. To quit game mode';
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODESEVEN;
+ return PLayAgainMSG;
+}
+
+function GAMEMODEVARIABLENUMBEROFDICEDECISION(
+ VARIABLENUMBEROFDICEUserDECISION
+) {
+ {
+ let MODEDecisionMSG;
+ if (VARIABLENUMBEROFDICEUserDECISION == "EXIT") {
+ GAMEMODEVARIABLENUMBEROFDICE = 0;
+ GAMEMODEVARIABLENUMBEROFDICECount = 1;
+ GAMEMODEVARIABLENUMBEROFDICEUserdiceroll = [];
+ GAMEMODEVARIABLENUMBEROFDICECommdiceroll = [];
+ GAMEMODEVARIABLENUMBEROFDICEUserdicerollSUM = 0;
+ GAMEMODEVARIABLENUMBEROFDICECommdicerollSUM = 0;
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEBEATTHATMODEONE;
+ PLAYMODE = "";
+ gameProcessState = GAMESTATETWO;
+ MODEDecisionMSG = GAMEMenuMSG;
+ } else {
+ GAMEMODEVARIABLENUMBEROFDICECount++;
+ GAMEMODEVARIABLENUMBEROFDICEUserdiceroll = [];
+ GAMEMODEVARIABLENUMBEROFDICECommdiceroll = [];
+ GAMEMODEVARIABLENUMBEROFDICEMODE = GAMEMODEVARIABLENUMBEROFDICEMODEONE;
+ MODEDecisionMSG = GAMEMODEVARIABLENUMBEROFDICEMODEone();
+ }
+ return MODEDecisionMSG;
+ }
+}
diff --git a/HaikuGen.js b/HaikuGen.js
new file mode 100644
index 00000000..462668c3
--- /dev/null
+++ b/HaikuGen.js
@@ -0,0 +1,22 @@
+var Haikurray = [
+ "Arise from sleep, old cat, And with great yawns and stretchings... Amble out for love β Issa",
+ "All Heaven and Earth Flowered white obliterate...Snow...unceasing snow - Hashin",
+ "April's air stirs in Willow-leaves...a butterfly Floats and balancesβ BashΕ",
+ "Many solemn nights Blond moon, we stand and marvel... Sleeping our noons way β Teitoku",
+ "Dead my old fine hopes And dry my dreaming but still...Iris, blue each spring β Shushiki",
+ "In the city fields Contemplating cherry-trees...Strangers are like friends β Issa",
+ "Many solemn nights Blond moon, we stand and marvel... Sleeping our noons away β Teitoku",
+ "Dead my old fine hopes And dry my dreaming but still... Iris, blue each Spring β Shushiki",
+ "Dew Evaporates And all our world is dew...so dear, So fresh, so fleeting β Issa",
+ "Mountain-rose petals Falling, falling, falling now... Waterfall music β BashΕ",
+ "Describe plum-blossoms? Better than my verses...white Wordless Butterflies β Reikan",
+ "Don't touch my plumtree! Said my friend and saying so... Broke the branch for me β Taigi",
+];
+
+var HaiKuGen = function () {
+ return "Haiku Generator
" + Haikurray[randNum()];
+};
+
+function randNum() {
+ return Math.floor(Math.random() * Haikurray.length);
+}
diff --git a/Matrix.gif b/Matrix.gif
new file mode 100644
index 00000000..c4340e00
Binary files /dev/null and b/Matrix.gif differ
diff --git a/index.html b/index.html
index 74f9da2a..1e956a65 100644
--- a/index.html
+++ b/index.html
@@ -1,27 +1,38 @@
+
+
+
+
+
Input:
- + + +Output:
- +Output:
+ + + +