import scala.util.Random
object DiceRollProgram {
private val rng = new Random()
// Returns a random number from 1 to 6
def rollDice(): Int =
rng.nextInt(6) + 1 // 0–5 → 1–6
def main(args: Array[String]): Unit = {
val dice1 = rollDice()
val dice2 = rollDice()
println(s"Dice 1: $dice1")
println(s"Dice 2: $dice2")
}
}
/*
run:
Dice 1: 5
Dice 2: 4
*/