Using a class to randomize dice rolls
up vote
-1
down vote
favorite
I'm writing a dice game program that creates a die for the user and computer, then asks for user name, number of sides on dice, and how many iterations the user would like to play with the computer. Then have the program check after each roll to see which roll is higher and at the end of the iterations it writes back the total wins for each user and computer and who the winner is. The problem i'm having is that I need to create a roll()
class to randomize the dice and set it to a value for the users roll and computers roll and i'm getting this error...
Exception in thread "main" java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at classwork6_3.Die.roll(Die.java:52)
at classwork6_3.ClassWork6_3.main(ClassWork6_3.java:29)
Here is my main()
class...
package classwork6_3;
import java.util.*;
public class ClassWork6_3
public static void main(String args)
Scanner s = new Scanner(System.in);
Random r = new Random();
System.out.print("Enter user's name: ");
String name = s.nextLine();
int value = 0;
int value2 = 0;
System.out.print("How many sides does the die have?: ");
int sides = s.nextInt();
s.nextLine();
System.out.print("How many times would you like to roll?: ");
int numRoll = s.nextInt();
int counter = 0;
int counter2 = 0;
Die user = new Die(name, sides, value);
Die comp = new Die(value);
for(int i = 1; i<= numRoll; i++)
value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;
System.out.printf("%s rolled: %dn", user.getOwner(), user.getValue());
System.out.print("Computer rolled: " + comp.getValue() + "nn");
if(value > value2)
counter++;
else if(value2 > value)
counter2++;
System.out.printf("%s TOTAL WINS: %dn", user.getOwner(), counter);
System.out.print("Computer TOTAL WINS: " + counter2 + "nn");
if(counter > counter2)
System.out.printf("%s wins!!n", user.getOwner());
else if(counter2 > counter)
System.out.print("Computer winsn");
else
System.out.print("It's a tie!n");
Here is my Die()
class...
package classwork6_3;
import java.util.*;
public class Die
Random r = new Random();
private int sides;
private int value;
private String owner;
public Die(String owner, int sides, int value)
this.sides = sides;
this.value = value;
this.owner = owner;
public Die (int value)
this.value = value;
public int getSides()
return sides;
public int getValue()
return value;
public String getOwner()
return owner;
public void setSides(int sides)
this.sides = sides;
public void setValue(int value)
this.value = value;
public void setOwner(String owner)
this.owner = owner;
public int roll(int rand)
rand = r.nextInt(value);
return value;
java
add a comment |
up vote
-1
down vote
favorite
I'm writing a dice game program that creates a die for the user and computer, then asks for user name, number of sides on dice, and how many iterations the user would like to play with the computer. Then have the program check after each roll to see which roll is higher and at the end of the iterations it writes back the total wins for each user and computer and who the winner is. The problem i'm having is that I need to create a roll()
class to randomize the dice and set it to a value for the users roll and computers roll and i'm getting this error...
Exception in thread "main" java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at classwork6_3.Die.roll(Die.java:52)
at classwork6_3.ClassWork6_3.main(ClassWork6_3.java:29)
Here is my main()
class...
package classwork6_3;
import java.util.*;
public class ClassWork6_3
public static void main(String args)
Scanner s = new Scanner(System.in);
Random r = new Random();
System.out.print("Enter user's name: ");
String name = s.nextLine();
int value = 0;
int value2 = 0;
System.out.print("How many sides does the die have?: ");
int sides = s.nextInt();
s.nextLine();
System.out.print("How many times would you like to roll?: ");
int numRoll = s.nextInt();
int counter = 0;
int counter2 = 0;
Die user = new Die(name, sides, value);
Die comp = new Die(value);
for(int i = 1; i<= numRoll; i++)
value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;
System.out.printf("%s rolled: %dn", user.getOwner(), user.getValue());
System.out.print("Computer rolled: " + comp.getValue() + "nn");
if(value > value2)
counter++;
else if(value2 > value)
counter2++;
System.out.printf("%s TOTAL WINS: %dn", user.getOwner(), counter);
System.out.print("Computer TOTAL WINS: " + counter2 + "nn");
if(counter > counter2)
System.out.printf("%s wins!!n", user.getOwner());
else if(counter2 > counter)
System.out.print("Computer winsn");
else
System.out.print("It's a tie!n");
Here is my Die()
class...
package classwork6_3;
import java.util.*;
public class Die
Random r = new Random();
private int sides;
private int value;
private String owner;
public Die(String owner, int sides, int value)
this.sides = sides;
this.value = value;
this.owner = owner;
public Die (int value)
this.value = value;
public int getSides()
return sides;
public int getValue()
return value;
public String getOwner()
return owner;
public void setSides(int sides)
this.sides = sides;
public void setValue(int value)
this.value = value;
public void setOwner(String owner)
this.owner = owner;
public int roll(int rand)
rand = r.nextInt(value);
return value;
java
1
Are you entering a negative number?
– Nicholas K
Nov 11 at 6:22
This doesn't make sense to me. Why do you need a parameter toroll()
, when the number of sides should (hint, it's not for comp) already be stored in the class? Why are you callingnextInt()
withvalue
? Shouldn't you be going for a random number bounded by the number of sides? Why aren't you actually returning the random number generated inroll()
?
– Matt
Nov 11 at 6:25
@NicholasK, i'm not entering any number, the program is suppose to randomly generate a number based on the number of sides I tell it that the dice is.
– Matt L.
Nov 11 at 6:54
@Matt, the instructions for this assignment wants me to make a class calledroll()
inside theDie()
class. I'm just trying to enter anything that will make this code operate properly, that's where i'm stuck.
– Matt L.
Nov 11 at 6:55
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I'm writing a dice game program that creates a die for the user and computer, then asks for user name, number of sides on dice, and how many iterations the user would like to play with the computer. Then have the program check after each roll to see which roll is higher and at the end of the iterations it writes back the total wins for each user and computer and who the winner is. The problem i'm having is that I need to create a roll()
class to randomize the dice and set it to a value for the users roll and computers roll and i'm getting this error...
Exception in thread "main" java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at classwork6_3.Die.roll(Die.java:52)
at classwork6_3.ClassWork6_3.main(ClassWork6_3.java:29)
Here is my main()
class...
package classwork6_3;
import java.util.*;
public class ClassWork6_3
public static void main(String args)
Scanner s = new Scanner(System.in);
Random r = new Random();
System.out.print("Enter user's name: ");
String name = s.nextLine();
int value = 0;
int value2 = 0;
System.out.print("How many sides does the die have?: ");
int sides = s.nextInt();
s.nextLine();
System.out.print("How many times would you like to roll?: ");
int numRoll = s.nextInt();
int counter = 0;
int counter2 = 0;
Die user = new Die(name, sides, value);
Die comp = new Die(value);
for(int i = 1; i<= numRoll; i++)
value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;
System.out.printf("%s rolled: %dn", user.getOwner(), user.getValue());
System.out.print("Computer rolled: " + comp.getValue() + "nn");
if(value > value2)
counter++;
else if(value2 > value)
counter2++;
System.out.printf("%s TOTAL WINS: %dn", user.getOwner(), counter);
System.out.print("Computer TOTAL WINS: " + counter2 + "nn");
if(counter > counter2)
System.out.printf("%s wins!!n", user.getOwner());
else if(counter2 > counter)
System.out.print("Computer winsn");
else
System.out.print("It's a tie!n");
Here is my Die()
class...
package classwork6_3;
import java.util.*;
public class Die
Random r = new Random();
private int sides;
private int value;
private String owner;
public Die(String owner, int sides, int value)
this.sides = sides;
this.value = value;
this.owner = owner;
public Die (int value)
this.value = value;
public int getSides()
return sides;
public int getValue()
return value;
public String getOwner()
return owner;
public void setSides(int sides)
this.sides = sides;
public void setValue(int value)
this.value = value;
public void setOwner(String owner)
this.owner = owner;
public int roll(int rand)
rand = r.nextInt(value);
return value;
java
I'm writing a dice game program that creates a die for the user and computer, then asks for user name, number of sides on dice, and how many iterations the user would like to play with the computer. Then have the program check after each roll to see which roll is higher and at the end of the iterations it writes back the total wins for each user and computer and who the winner is. The problem i'm having is that I need to create a roll()
class to randomize the dice and set it to a value for the users roll and computers roll and i'm getting this error...
Exception in thread "main" java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at classwork6_3.Die.roll(Die.java:52)
at classwork6_3.ClassWork6_3.main(ClassWork6_3.java:29)
Here is my main()
class...
package classwork6_3;
import java.util.*;
public class ClassWork6_3
public static void main(String args)
Scanner s = new Scanner(System.in);
Random r = new Random();
System.out.print("Enter user's name: ");
String name = s.nextLine();
int value = 0;
int value2 = 0;
System.out.print("How many sides does the die have?: ");
int sides = s.nextInt();
s.nextLine();
System.out.print("How many times would you like to roll?: ");
int numRoll = s.nextInt();
int counter = 0;
int counter2 = 0;
Die user = new Die(name, sides, value);
Die comp = new Die(value);
for(int i = 1; i<= numRoll; i++)
value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;
System.out.printf("%s rolled: %dn", user.getOwner(), user.getValue());
System.out.print("Computer rolled: " + comp.getValue() + "nn");
if(value > value2)
counter++;
else if(value2 > value)
counter2++;
System.out.printf("%s TOTAL WINS: %dn", user.getOwner(), counter);
System.out.print("Computer TOTAL WINS: " + counter2 + "nn");
if(counter > counter2)
System.out.printf("%s wins!!n", user.getOwner());
else if(counter2 > counter)
System.out.print("Computer winsn");
else
System.out.print("It's a tie!n");
Here is my Die()
class...
package classwork6_3;
import java.util.*;
public class Die
Random r = new Random();
private int sides;
private int value;
private String owner;
public Die(String owner, int sides, int value)
this.sides = sides;
this.value = value;
this.owner = owner;
public Die (int value)
this.value = value;
public int getSides()
return sides;
public int getValue()
return value;
public String getOwner()
return owner;
public void setSides(int sides)
this.sides = sides;
public void setValue(int value)
this.value = value;
public void setOwner(String owner)
this.owner = owner;
public int roll(int rand)
rand = r.nextInt(value);
return value;
java
java
asked Nov 11 at 6:14
Matt L.
218
218
1
Are you entering a negative number?
– Nicholas K
Nov 11 at 6:22
This doesn't make sense to me. Why do you need a parameter toroll()
, when the number of sides should (hint, it's not for comp) already be stored in the class? Why are you callingnextInt()
withvalue
? Shouldn't you be going for a random number bounded by the number of sides? Why aren't you actually returning the random number generated inroll()
?
– Matt
Nov 11 at 6:25
@NicholasK, i'm not entering any number, the program is suppose to randomly generate a number based on the number of sides I tell it that the dice is.
– Matt L.
Nov 11 at 6:54
@Matt, the instructions for this assignment wants me to make a class calledroll()
inside theDie()
class. I'm just trying to enter anything that will make this code operate properly, that's where i'm stuck.
– Matt L.
Nov 11 at 6:55
add a comment |
1
Are you entering a negative number?
– Nicholas K
Nov 11 at 6:22
This doesn't make sense to me. Why do you need a parameter toroll()
, when the number of sides should (hint, it's not for comp) already be stored in the class? Why are you callingnextInt()
withvalue
? Shouldn't you be going for a random number bounded by the number of sides? Why aren't you actually returning the random number generated inroll()
?
– Matt
Nov 11 at 6:25
@NicholasK, i'm not entering any number, the program is suppose to randomly generate a number based on the number of sides I tell it that the dice is.
– Matt L.
Nov 11 at 6:54
@Matt, the instructions for this assignment wants me to make a class calledroll()
inside theDie()
class. I'm just trying to enter anything that will make this code operate properly, that's where i'm stuck.
– Matt L.
Nov 11 at 6:55
1
1
Are you entering a negative number?
– Nicholas K
Nov 11 at 6:22
Are you entering a negative number?
– Nicholas K
Nov 11 at 6:22
This doesn't make sense to me. Why do you need a parameter to
roll()
, when the number of sides should (hint, it's not for comp) already be stored in the class? Why are you calling nextInt()
with value
? Shouldn't you be going for a random number bounded by the number of sides? Why aren't you actually returning the random number generated in roll()
?– Matt
Nov 11 at 6:25
This doesn't make sense to me. Why do you need a parameter to
roll()
, when the number of sides should (hint, it's not for comp) already be stored in the class? Why are you calling nextInt()
with value
? Shouldn't you be going for a random number bounded by the number of sides? Why aren't you actually returning the random number generated in roll()
?– Matt
Nov 11 at 6:25
@NicholasK, i'm not entering any number, the program is suppose to randomly generate a number based on the number of sides I tell it that the dice is.
– Matt L.
Nov 11 at 6:54
@NicholasK, i'm not entering any number, the program is suppose to randomly generate a number based on the number of sides I tell it that the dice is.
– Matt L.
Nov 11 at 6:54
@Matt, the instructions for this assignment wants me to make a class called
roll()
inside the Die()
class. I'm just trying to enter anything that will make this code operate properly, that's where i'm stuck.– Matt L.
Nov 11 at 6:55
@Matt, the instructions for this assignment wants me to make a class called
roll()
inside the Die()
class. I'm just trying to enter anything that will make this code operate properly, that's where i'm stuck.– Matt L.
Nov 11 at 6:55
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
Here are the issues with your code :
You are never returning the random value generated by the
roll(...)
methodpublic int roll(int rand)
rand = r.nextInt(value);
return value;Change it to
public int roll(int rand)
return r.nextInt(rand);Within the for-loop all you need to do is just call the
roll()
method. Since it already calculates the random value of the die, there is no need for you to callr.nextInt()
again.value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;Change it to
value = user.roll(sides) + 1;
value2 = comp.roll(sides) + 1;Now print out the values using :
System.out.printf("%s rolled: %dn", user.getOwner(), value);
System.out.print("Computer rolled: " + value2 + "nn");
Your code will work as expected after performing the above mentioned steps. Also as a side note do not use variable names that have an ambiguous meaning like value, value2 etc.
add a comment |
up vote
0
down vote
Whenever you make a new die, your value
is never changed from zero, causing that error to pop-up since the range it would be looking through whenever you call roll(), acording to your Die class, is 0 to 0. Change value
to the value the user puts in and the make a new die.
This should solve the error, however I don't believe that the program will function correctly. Just looking atroll()
, you can see that the random value generated is never actually used.
– Matt
Nov 11 at 6:39
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he calledroll()
– Kyle Henry
Nov 11 at 6:42
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Here are the issues with your code :
You are never returning the random value generated by the
roll(...)
methodpublic int roll(int rand)
rand = r.nextInt(value);
return value;Change it to
public int roll(int rand)
return r.nextInt(rand);Within the for-loop all you need to do is just call the
roll()
method. Since it already calculates the random value of the die, there is no need for you to callr.nextInt()
again.value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;Change it to
value = user.roll(sides) + 1;
value2 = comp.roll(sides) + 1;Now print out the values using :
System.out.printf("%s rolled: %dn", user.getOwner(), value);
System.out.print("Computer rolled: " + value2 + "nn");
Your code will work as expected after performing the above mentioned steps. Also as a side note do not use variable names that have an ambiguous meaning like value, value2 etc.
add a comment |
up vote
1
down vote
accepted
Here are the issues with your code :
You are never returning the random value generated by the
roll(...)
methodpublic int roll(int rand)
rand = r.nextInt(value);
return value;Change it to
public int roll(int rand)
return r.nextInt(rand);Within the for-loop all you need to do is just call the
roll()
method. Since it already calculates the random value of the die, there is no need for you to callr.nextInt()
again.value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;Change it to
value = user.roll(sides) + 1;
value2 = comp.roll(sides) + 1;Now print out the values using :
System.out.printf("%s rolled: %dn", user.getOwner(), value);
System.out.print("Computer rolled: " + value2 + "nn");
Your code will work as expected after performing the above mentioned steps. Also as a side note do not use variable names that have an ambiguous meaning like value, value2 etc.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Here are the issues with your code :
You are never returning the random value generated by the
roll(...)
methodpublic int roll(int rand)
rand = r.nextInt(value);
return value;Change it to
public int roll(int rand)
return r.nextInt(rand);Within the for-loop all you need to do is just call the
roll()
method. Since it already calculates the random value of the die, there is no need for you to callr.nextInt()
again.value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;Change it to
value = user.roll(sides) + 1;
value2 = comp.roll(sides) + 1;Now print out the values using :
System.out.printf("%s rolled: %dn", user.getOwner(), value);
System.out.print("Computer rolled: " + value2 + "nn");
Your code will work as expected after performing the above mentioned steps. Also as a side note do not use variable names that have an ambiguous meaning like value, value2 etc.
Here are the issues with your code :
You are never returning the random value generated by the
roll(...)
methodpublic int roll(int rand)
rand = r.nextInt(value);
return value;Change it to
public int roll(int rand)
return r.nextInt(rand);Within the for-loop all you need to do is just call the
roll()
method. Since it already calculates the random value of the die, there is no need for you to callr.nextInt()
again.value = r.nextInt(user.roll(sides)) + 1;
value2 = r.nextInt(comp.roll(sides)) + 1;Change it to
value = user.roll(sides) + 1;
value2 = comp.roll(sides) + 1;Now print out the values using :
System.out.printf("%s rolled: %dn", user.getOwner(), value);
System.out.print("Computer rolled: " + value2 + "nn");
Your code will work as expected after performing the above mentioned steps. Also as a side note do not use variable names that have an ambiguous meaning like value, value2 etc.
edited Nov 11 at 10:38
answered Nov 11 at 10:25
Nicholas K
4,20241029
4,20241029
add a comment |
add a comment |
up vote
0
down vote
Whenever you make a new die, your value
is never changed from zero, causing that error to pop-up since the range it would be looking through whenever you call roll(), acording to your Die class, is 0 to 0. Change value
to the value the user puts in and the make a new die.
This should solve the error, however I don't believe that the program will function correctly. Just looking atroll()
, you can see that the random value generated is never actually used.
– Matt
Nov 11 at 6:39
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he calledroll()
– Kyle Henry
Nov 11 at 6:42
add a comment |
up vote
0
down vote
Whenever you make a new die, your value
is never changed from zero, causing that error to pop-up since the range it would be looking through whenever you call roll(), acording to your Die class, is 0 to 0. Change value
to the value the user puts in and the make a new die.
This should solve the error, however I don't believe that the program will function correctly. Just looking atroll()
, you can see that the random value generated is never actually used.
– Matt
Nov 11 at 6:39
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he calledroll()
– Kyle Henry
Nov 11 at 6:42
add a comment |
up vote
0
down vote
up vote
0
down vote
Whenever you make a new die, your value
is never changed from zero, causing that error to pop-up since the range it would be looking through whenever you call roll(), acording to your Die class, is 0 to 0. Change value
to the value the user puts in and the make a new die.
Whenever you make a new die, your value
is never changed from zero, causing that error to pop-up since the range it would be looking through whenever you call roll(), acording to your Die class, is 0 to 0. Change value
to the value the user puts in and the make a new die.
edited Nov 11 at 6:40
answered Nov 11 at 6:35
Kyle Henry
14
14
This should solve the error, however I don't believe that the program will function correctly. Just looking atroll()
, you can see that the random value generated is never actually used.
– Matt
Nov 11 at 6:39
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he calledroll()
– Kyle Henry
Nov 11 at 6:42
add a comment |
This should solve the error, however I don't believe that the program will function correctly. Just looking atroll()
, you can see that the random value generated is never actually used.
– Matt
Nov 11 at 6:39
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he calledroll()
– Kyle Henry
Nov 11 at 6:42
This should solve the error, however I don't believe that the program will function correctly. Just looking at
roll()
, you can see that the random value generated is never actually used.– Matt
Nov 11 at 6:39
This should solve the error, however I don't believe that the program will function correctly. Just looking at
roll()
, you can see that the random value generated is never actually used.– Matt
Nov 11 at 6:39
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he called
roll()
– Kyle Henry
Nov 11 at 6:42
Yea, that confused me. When I was looking at the code, I guessed that was a typo since that parameter was never used whenever he called
roll()
– Kyle Henry
Nov 11 at 6:42
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246332%2fusing-a-class-to-randomize-dice-rolls%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Are you entering a negative number?
– Nicholas K
Nov 11 at 6:22
This doesn't make sense to me. Why do you need a parameter to
roll()
, when the number of sides should (hint, it's not for comp) already be stored in the class? Why are you callingnextInt()
withvalue
? Shouldn't you be going for a random number bounded by the number of sides? Why aren't you actually returning the random number generated inroll()
?– Matt
Nov 11 at 6:25
@NicholasK, i'm not entering any number, the program is suppose to randomly generate a number based on the number of sides I tell it that the dice is.
– Matt L.
Nov 11 at 6:54
@Matt, the instructions for this assignment wants me to make a class called
roll()
inside theDie()
class. I'm just trying to enter anything that will make this code operate properly, that's where i'm stuck.– Matt L.
Nov 11 at 6:55