repl.it
@PacoTaco/

Random dice

Java

No description

fork
loading
Files
  • Main.java
  • jdt.ls-java-project
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import java.util.Random;
class Main {
  public static void main(String[] args) {
    Random r = new Random();
    int dice1 = r.nextInt(6)+1;
    int dice2 = r.nextInt(6)+1;
    int dice3 = r.nextInt(6)+1;
    System.out.println(dice1);
    System.out.println(dice2);
    System.out.println(dice3);
    if(dice1 == dice2||dice1 == dice3||dice2 == dice3){
      System.out.println("double");
    }
    for(int i = 0; i < 100; i++){
      System.out.println(i);
    }
    for(int j = 15 ; j <= 30 ; j += 3){
      System.out.println(j);
    }
  }
}
Fetching token
?