I'm working on a rolling dice program. The rules are below. I'm not sure how to reassign a value. For example, a value of 1 and 2, would equal 1; a value of 3 and 4, would equal 2; and a value of 5 and 6, would equal 3.
The Rules Are:
- 3 die
- Roll 1 = value 1 and 2
- Roll 2 = value 3 and 4
- Roll 3 = value 5 and 6
This is the code I have so far:
int R1 = 0;
int R2 = 0;
int R3 = 0;
while (( R1 <= 0 ) || ( R1 >= 7 )) {
printf( "Enter a value [1-6] to roll the dice: " );
scanf( "%d", &R1 );
}
while (( R2 <= 0 ) || ( R2 >= 7 )) {
printf( "Enter a value [1 - 6] to roll the dice: " );
scanf( "%d", &R2 );
}
while (( R3 <= 0 ) || ( R3 >= 7 )) {
printf( "Enter a value [1 - 6] to roll the dice: " );
scanf( "%d", &R3 );
}