Skip to content

Commit

Permalink
Add Haxedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
lulunac27a committed Apr 21, 2024
1 parent 18c01f3 commit a5c7853
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dice-game/src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ class Main {
rollDice(Sys.stdin()); // get input to roll the dice based on input
}

/**
* Format the number with commas as thousand seperator.
* @param number Number to format
* @return Number with commas as thousand seperator
*/
static function numberWithCommas(number:Int):String {
var numString:String = Std.string(number);
var numLen:Int = numString.length;
Expand All @@ -18,6 +23,9 @@ class Main {
return output;
}

/**
* Rolls the dice.
*/
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
Expand Down

0 comments on commit a5c7853

Please sign in to comment.