about summary refs log tree commit diff
path: root/usth/ICT2.2/labwork/1/SumOfTwoDice.java
blob: d955f28ab77c07c13fdc38e107e2579ee49795a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import java.util.concurrent.ThreadLocalRandom;

class SumOfTwoDice
{
  public static void main(String... args)
  {
    int x = ThreadLocalRandom.current().nextInt(1, 7);
    System.out.println("First roll: " + x);
    int y = ThreadLocalRandom.current().nextInt(1, 7);
    System.out.println("Second roll: " + y);
    System.out.println("Sum: " + (x + y));
  }
}