jeudi 14 mars 2019

Java D20 dice roller

I'm trying to create a dice rolling class for a text-based RPG in java. I'm super new to programming and looking for some help. Thanks in advance!!

    import java.util.Random;

    public class Dice {

    public Random random;


    public Dice () {
        this.random = new Random();

    }

    public int roll () {
        int rand = random.nextInt(20);
    }


    System.out.println("\nThe dice rolled a " + rand + ".");

}




Aucun commentaire:

Enregistrer un commentaire