Commit 0d221e34 authored by Weber Rodolphe's avatar Weber Rodolphe

Delete Dice.java

parent 9a85421a
/**
* @file
* @author WEBER rodolphe <rodolphe.weber@univ-orleans.fr>
* @version 1.0
* @date 22/07/2021
*
* @section LICENSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* @section DESCRIPTION
*
* This java file represents a java lab for the 4th year students of Polytech Orleans.
*/
/**
* @brief generates a random integer value
*
* the range is between 1 and numberValues
*/
public class Dice {
private int numberValues; /**< range of the dice */
public int diceValue; /**< dice value */
/**
* @brief parametrized constructor
* @param numberValues int indicating the dice range
*/
Dice(int numberValues){
this.numberValues=numberValues;
roll();
}
/**
* @brief default constructor
*/
Dice(){
numberValues=6;
roll();
}
/**
* @brief roll the dice
*/
public void roll(){
diceValue= (int)(Math.random()*(numberValues))+1;
}
/**
* @brief print the dice value
*/
public void printDice(){
System.out.println(diceValue);
}
/**
* @brief get the dice range
* @return int dice range
*/
public int getDiceType(){
return numberValues;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment