Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int twoPairs() {
- int i;
- for(i = 1 ; i < NUMBEROFDICE-2 ; i++){
- if((getDie(i) == getDie(i+1)) && (getDie(i+2) == getDie(i+3))){
- return(getDie(i) + getDie(i+1) + getDie(i+2) + getDie(i+3));
- } else if((getDie(i) == getDie(i+1)) && (getDie(i+3) == getDie(i+4))){
- return(getDie(i) + getDie(i+1) + getDie(i+3) + getDie(i+4));
- }
- else return 0;
- }
- }
Add Comment
Please, Sign In to add comment