SHARE
TWEET

Java dobbelstenen

a guest Sep 23rd, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. import java.util.Random;
  3.  
  4. class Main {
  5.   public static void main(String[] args) {
  6.     Scanner scanInput = new Scanner(System.in);
  7.     Random rng = new Random();
  8.  
  9.     System.out.println("Hoevaak moet er gerold worden?");
  10.     int numberOfDice = scanInput.nextInt();
  11.     for (int i=0; i<numberOfDice;i++) {
  12.       int roll = rng.nextInt(6) + 1;
  13.       System.out.println("Dobbelsteen " + i + ": " + roll);
  14.     }
  15.   }
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top