Skip to content

Commit

Permalink
Make comments easier to understand
Browse files Browse the repository at this point in the history
  • Loading branch information
lulunac27a committed Apr 16, 2024
1 parent ba7f8a6 commit 0eb4bcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dice-game-webapp/src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int> = []; // 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
Expand Down
2 changes: 1 addition & 1 deletion dice-game/src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Int> = []; // 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
Expand Down

0 comments on commit 0eb4bcc

Please sign in to comment.