CPRand

object CPRand

Provides convenient functions for random number generation and usage.

See also:

Random

Source:
CPRand.scala
class Object
trait Matchable
class Any
CPRand.type

Value members

Concrete methods

def between(a: Int, b: Int): Int

Gets random number in given range.

Gets random number in given range.

Value parameters:
a

Inclusive start of the range.

b

Exclusive end of the range.

Source:
CPRand.scala
def between(a: Double, b: Double): Double

Gets random number in given range.

Gets random number in given range.

Value parameters:
a

Inclusive start of the range.

b

Exclusive end of the range.

Source:
CPRand.scala
def between(a: Long, b: Long): Long

Gets random number in given range.

Gets random number in given range.

Value parameters:
a

Inclusive start of the range.

b

Exclusive end of the range.

Source:
CPRand.scala
def between(a: Float, b: Float): Float

Gets random number in given range.

Gets random number in given range.

Value parameters:
a

Inclusive start of the range.

b

Exclusive end of the range.

Source:
CPRand.scala
def coinFlip(): Boolean

Random boolean value.

Random boolean value.

Source:
CPRand.scala
def guid: String

Creates new globally unique 16-bytes type 4 UUID.

Creates new globally unique 16-bytes type 4 UUID.

Source:
CPRand.scala
def guid6: String

Creates new 6-bytes UUID. This UUID is NOT globally unique.

Creates new 6-bytes UUID. This UUID is NOT globally unique.

Source:
CPRand.scala

Gets a random green color from the list of CPColor.CS_X11_GREENS.

Gets a random green color from the list of CPColor.CS_X11_GREENS.

Source:
CPRand.scala
def rand[T](seq: Seq[T]): T

Gets random value from the given sequence. It's equivalent to:

Gets random value from the given sequence. It's equivalent to:

   seq(RND.nextInt(seq.size))
Value parameters:
seq

Sequence to get the random value from.

Source:
CPRand.scala
def randDigit(): Char

Geta a random digit.

Geta a random digit.

Source:
CPRand.scala
def randDouble(): Double

Gets the next pseudorandom, uniformly distributed double value between 0.0 and 1.0.

Gets the next pseudorandom, uniformly distributed double value between 0.0 and 1.0.

Source:
CPRand.scala
def randFloat(): Float

Gets the next pseudorandom, uniformly distributed float value between 0.0 and 1.0.

Gets the next pseudorandom, uniformly distributed float value between 0.0 and 1.0.

Source:
CPRand.scala
def randInt(from: Int, to: Int): Int

Gets random integer in the given range.

Gets random integer in the given range.

Value parameters:
from

Inclusive range from value.

to

Inclusive range to value.

Source:
CPRand.scala
def randInt(): Int

Gets random integer.

Gets random integer.

Source:
CPRand.scala
def randIntExcl(from: Int, to: Int): Int

Gets random integer in the given range.

Gets random integer in the given range.

Value parameters:
from

Inclusive range from value.

to

Inclusive range to value.

Source:
CPRand.scala
def randIntIncl(from: Int, to: Int): Int

Gets random integer in the given range.

Gets random integer in the given range.

Value parameters:
from

Inclusive range from value.

to

Inclusive range to value.

Source:
CPRand.scala
def randLetter(): Char

Gets a random uppercase or lowercase letter.

Gets a random uppercase or lowercase letter.

Source:
CPRand.scala
def randLoLetter(): Char

Gets a random lowercase letter.

Gets a random lowercase letter.

Source:
CPRand.scala
def randLong(from: Long, to: Long): Long

Gets random long in the given range.

Gets random long in the given range.

Value parameters:
from

Inclusive range from value.

to

Inclusive range to value.

Source:
CPRand.scala
def randLongExcl(from: Long, to: Long): Long

Gets random long in the given range.

Gets random long in the given range.

Value parameters:
from

Inclusive range from value.

to

Inclusive range to value.

Source:
CPRand.scala
def randSymbol(): Char

Gets a random symbol from the list of ~!@#$%^&*()_+-=[]{}';:\",.<>/?.

Gets a random symbol from the list of ~!@#$%^&*()_+-=[]{}';:\",.<>/?.

Source:
CPRand.scala

Gets a random system color from the list of CPColor.C_SYS_GROUP.

Gets a random system color from the list of CPColor.C_SYS_GROUP.

Source:
CPRand.scala
def randUpLetter(): Char

Gets a random uppercase letter.

Gets a random uppercase letter.

Source:
CPRand.scala

Gets a random blue color from the list of CPColor.CS_X11_BLUES.

Gets a random blue color from the list of CPColor.CS_X11_BLUES.

Source:
CPRand.scala

Gets a random brown color from the list of CPColor.CS_X11_BROWNS.

Gets a random brown color from the list of CPColor.CS_X11_BROWNS.

Source:
CPRand.scala

Gets random xterm color from the list of CPColor.CS_X11_ALL.

Gets random xterm color from the list of CPColor.CS_X11_ALL.

Source:
CPRand.scala

Gets a random cyan color from the list of CPColor.CS_X11_CYANS.

Gets a random cyan color from the list of CPColor.CS_X11_CYANS.

Source:
CPRand.scala

Gets a random gray color from the list of CPColor.CS_X11_GRAYS.

Gets a random gray color from the list of CPColor.CS_X11_GRAYS.

Source:
CPRand.scala

Gets a random orange color from the list of CPColor.CS_X11_ORANGES.

Gets a random orange color from the list of CPColor.CS_X11_ORANGES.

Source:
CPRand.scala

Gets a random pink color from the list of CPColor.CS_X11_PINKS.

Gets a random pink color from the list of CPColor.CS_X11_PINKS.

Source:
CPRand.scala

Gets a random purple color from the list of CPColor.CS_X11_PURPLES.

Gets a random purple color from the list of CPColor.CS_X11_PURPLES.

Source:
CPRand.scala

Gets a random red color from the list of CPColor.CS_X11_REDS.

Gets a random red color from the list of CPColor.CS_X11_REDS.

Source:
CPRand.scala

Gets a random white color from the list of CPColor.CS_X11_WHITES.

Gets a random white color from the list of CPColor.CS_X11_WHITES.

Source:
CPRand.scala

Gets a random yellow color from the list of CPColor.CS_X11_YELLOWS.

Gets a random yellow color from the list of CPColor.CS_X11_YELLOWS.

Source:
CPRand.scala

Gets random xterm color from the list of CPColor.CS_XTERM_ALL.

Gets random xterm color from the list of CPColor.CS_XTERM_ALL.

Source:
CPRand.scala