@@ -267,3 +272,31 @@ int sum_dice_matching_value(struct die_st *dice, unsigned int value) {
}
returnsum;
}
intsum_dice(structdie_st*dice){
intsum=0;
for(unsignedinti=0;i<NUM_DICE;i++){
sum+=(int)dice[i].value;
}
returnsum;
}
// I know this is uglier than it could be, but I don't have a hash map implementation in C and don't want to allocate the memory to track which values we've seen before.
unsignedintpoints_awarded=calculate_selection_score(ctx,selection);// todo we should use the return value for this to assign the point value, not do it within get_player_score_selection()