Posted by Lisa on Tuesday, October 13, 2009 at 12:37am.
A Boolean variable is a variable, like an int or a string, but whose value is either "true" or "false".
Try this little lump of code, and vary d1 and d2 values, to see the effect:
int d1 = 1
int d2 = 1
boolean snakeeyes;
boolean doubles;
boolean boxcars;
snakeeyes = (d1 + d2 == 2);
doubles = (d1 == d2);
boxcars = (d1 + d2 = 12);
System.out.println("Is this snake-eyes?");
System.out.println(snakeeyes);
// and you can also use it in a logical statement
System.out.println("Is this bpxcars?");
if (boxcars) System.out.println("Yes");
and so on.
It's not clear from your description whether your project calls for one boolean condition for each condition or one for any of them, but I hope this example will illustrate the general method.
Related Questions
Programming Logic - I need to create a flowchart/psuedocode for a dice game that...
English - Playing the dice game, have a conversation about what you must do and ...
English expression - Playing the dice game, write down suitable responses and ...
English expression - There is only one die in playing the dice game. They are ...
Algebra - You are a contestant on a game show and have the chance to win a car ...
English - Roll the dice. If you get 3 on the face of the dice, move forward for ...
Mathematics for Liberal Arts - You are on a TV show. You have been asked to ...
Math - Suppose you play a game in which two fair standard dice are rolled. If ...
math - Dice is a popular game in gambling casinos. Two dice are tossed, and ...
ALGEBRA - Dice is a popular game in gambling casinos. Two dice are tossed, and ...
For Further Reading