Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class DiceHelper {
- private static final Random rng = new Random();
- public static void main(String[] args) {
- // use for testing purposes
- }
- /**
- * Returns the result of rolling a dice with s sides.
- * @param sides the number of sides on the dice
- * @return the sum of dice rolled
- */
- public static int roll(int sides) {
- // your code here
- }
- /**
- * Returns the sum of rolling n dice with s sides.
- *
- * @param sides the number of sides on each dice to roll
- * @param numRolls the number of dice to roll
- * @return the sum of dice rolled
- */
- public static int roll(int sides, int numRolls) {
- // your code here
- }
- /**
- * Returns the sum of rolling n dice with s sides
- * and adds m to the result of each roll.
- *
- * @param sides the number of sides on each dice to roll
- * @param numRolls the number of dice to roll
- * @param modifier the amount to add to the result of each dice roll
- * @return the sum of dice rolled
- */
- public static int roll(int sides, int numRolls, int modifier) {
- // your code here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement