Skip to content

jtfmumm/randomific

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

randomific

Randomization utility functions.

API

  • randInt(low: Int, high: Int): Int

  • roll(sides: Int): Int

  • nRolls(n: Int, sides: Int): Int

  • rollFromZero(sides: Int): Int

    • Returns an Int from 0 to (sides - 1)
  • flip(): Int

    • Returns 0 or 1
  • rolledByOdds(odds: Double): Boolean

    • Takes a Double from 0 to 1. Rolls against the odds.
  • pickItem[A](s: Seq[A]): A

  • kRandIntsBetween(k: Int, low: Int, high: Int): Seq[Int]

    • Returns k unique Ints from low and high
  • pickKItems[A](k: Int, s: Seq[A]): Seq[A]

    • Picks k unique items from s

About

Basic utility functions for randomization in Scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published