Commit 27da3ca1 authored by Chris's avatar Chris
Browse files

fixed bug with large straight not awarding points in valid large straight scenarios

parent dab2c47e
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -322,6 +322,14 @@ unsigned int n_of_a_kind(struct die_st *dice, unsigned int num_dice, unsigned in
}

unsigned int n_in_a_row(struct die_st *dice, unsigned int num_dice, unsigned int n) {
    // testing only: large straight (note: this scores 0 despite being valid!) BUT this does register as a small straight.
//    dice[0].value = 6;
//    dice[1].value = 2;
//    dice[2].value = 5;
//    dice[3].value = 4;
//    dice[4].value = 3;


    if (n > num_dice) {
        printf("n_in_a_row(): error: n is greater than num_dice");
    }
@@ -337,7 +345,7 @@ unsigned int n_in_a_row(struct die_st *dice, unsigned int num_dice, unsigned int
                    return 1;
                }
                next_in_sequence++;
                j = 0;
                j = -1; // because we want j == 0 and the loop will immediately j++
            }
        }
    }