Loading yaht.c +2 −6 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ int main() { game_context ctx; // initialize random device for game state ctx.random_device_fd = get_urandom(); unsigned int *next_roll = malloc(sizeof(unsigned int) * NUM_DICE); int next_roll[NUM_DICE]; printf("yaht.c\n"); Loading @@ -56,17 +56,13 @@ int main() { set_die_held(&ctx, 0, 1); set_die_held(&ctx, 1, 1); set_die_held(&ctx, 4, 1); // set_die_held(&ctx, 5, 1); // set_die_held(&ctx, 5, 1); // tests edge case // second roll roll_multiple_dice(&ctx, next_roll, 1); print_multiple_dice(next_roll, NUM_DICE, 0); // free the next_roll var (mallon) if (next_roll) { free(next_roll); } fclose(ctx.random_device_fd); return 0; } Loading yahtc −120 B (16.6 KiB) File changed.No diff preview for this file type. View original file View changed file Loading
yaht.c +2 −6 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ int main() { game_context ctx; // initialize random device for game state ctx.random_device_fd = get_urandom(); unsigned int *next_roll = malloc(sizeof(unsigned int) * NUM_DICE); int next_roll[NUM_DICE]; printf("yaht.c\n"); Loading @@ -56,17 +56,13 @@ int main() { set_die_held(&ctx, 0, 1); set_die_held(&ctx, 1, 1); set_die_held(&ctx, 4, 1); // set_die_held(&ctx, 5, 1); // set_die_held(&ctx, 5, 1); // tests edge case // second roll roll_multiple_dice(&ctx, next_roll, 1); print_multiple_dice(next_roll, NUM_DICE, 0); // free the next_roll var (mallon) if (next_roll) { free(next_roll); } fclose(ctx.random_device_fd); return 0; } Loading
yahtc −120 B (16.6 KiB) File changed.No diff preview for this file type. View original file View changed file