Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static int[] multiRoll(int input) {
        int[] results = { 0, 0, 0, 0, 0, 0 };

        int dieRoll = 0;

        for (int count = 0; count < input; count++) {
            dieRoll = roll();
            results[dieRoll - 1]++;
        }

        return results;
    }

    public static int roll() {
        return (int) Math.ceil(Math.random() * 6);
    }
}