From 0eb4bcccaedfb61a0cadcf7aa937ffe3d0f75c70 Mon Sep 17 00:00:00 2001 From: lulunac27a <100660343+lulunac27a@users.noreply.github.com> Date: Mon, 15 Apr 2024 20:07:40 -0500 Subject: [PATCH] Make comments easier to understand --- dice-game-webapp/src/Main.hx | 2 +- dice-game/src/Main.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dice-game-webapp/src/Main.hx b/dice-game-webapp/src/Main.hx index 212c408..855da6f 100644 --- a/dice-game-webapp/src/Main.hx +++ b/dice-game-webapp/src/Main.hx @@ -9,7 +9,7 @@ class Main { var numberOfDice:Int = Std.parseInt(diceInput.value); // get number of dice to roll appContent.innerHTML = ""; // set app content to empty string var dice:Array = []; // initialize dice array - var sum:Int = 0; // initialize sum to 0 + var sum:Int = 0; // initialize dice sum to 0 for (i in 0...numberOfDice) { dice[i] = Std.random(6) + 1; // roll the dice sum += dice[i]; // add die value to sum diff --git a/dice-game/src/Main.hx b/dice-game/src/Main.hx index 9c9aa56..476583f 100644 --- a/dice-game/src/Main.hx +++ b/dice-game/src/Main.hx @@ -8,7 +8,7 @@ class Main { static function rollDice(input:haxe.io.Input):Void { var numberOfDice:Int = Std.parseInt(input.readLine()); // parse input to integer var dice:Array = []; // initialize empty array of dice - var sum:Int = 0; // initialize sum to 0 + var sum:Int = 0; // initialize dice sum to 0 for (i in 0...numberOfDice) { // loop to entered number of dice based on input dice[i] = Std.random(6) + 1; // add dice array to rolled die and make dice result is between 1 to 6 sum += dice[i]; // add die value to sum