d4 static method

int d4()

Roll a four-sided dice. Returns an integer in 1-4 (inclusive).

Implementation

static int d4() => random.nextInt(3) + 1;