Last active
February 2, 2024 19:45
-
-
Save valorad/f24ebcf4df1973843a3368d62cef03a9 to your computer and use it in GitHub Desktop.
Revisions
-
valorad revised this gist
Feb 2, 2024 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,5 @@ maxValue = tmp; } return Math.floor(Math.random() * (maxValue - minValue) + minValue); } -
valorad created this gist
Jul 21, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ /** * get a random Integer number ∈ [minValue, maxValue) */ public Integer getRandomNumberBetween(Integer minValue, Integer maxValue) { if (minValue > maxValue) { // swap position Integer tmp = minValue; minValue = maxValue; maxValue = tmp; } min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min) + min); }