Skip to content

Commit

Permalink
Fixed generation bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Hippo committed Jul 24, 2020
1 parent 775c7ae commit d52527b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ var inlineJSR = true
var logLibraries = false

var transformers = [
"ConfusingSwitch"
"FakeTryCatches"
];

var libraries = [

]

var exclude = [
"me/hippo"
]

var FakeTryCatches = {
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/rip/hippo/mosey/util/MathUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import scala.util.Random

/**
* @author Hippo
* @version 1.0.0, 7/11/20
* @version 1.0.1, 7/11/20
* @since 1.0.0
*/
object MathUtil {


def generate(min: Int, max: Int): Int = {
Random.nextInt(min - max) + min
}
def generate(min: Int, max: Int): Int =
Random.nextInt(max - min) + min

def chance(percentage: Int): Boolean = {

def chance(percentage: Int): Boolean =
percentage >= generate(0, 101)
}


def generate: Int = Random.nextInt(Int.MaxValue)

Expand Down

0 comments on commit d52527b

Please sign in to comment.