void game_roll (struct Game *game, int roll) { printf ("%s is the current player\n", game->players[game->current_player]); printf ("They have rolled a %d\n", roll); if (game->in_penalty_box[game->current_player]) { if (roll % 2 != 0) { game->is_getting_out_of_penalty_box = true; printf ("%s is getting out of the penalty box\n", game->players[game->current_player]); game->places[game->current_player] = game->places[game->current_player] + roll; if (game->places[game->current_player] > 11) game->places[game->current_player] = game->places[game->current_player] - 12; printf ("%s's new location is %d\n", game->players[game->current_player], game->places[game->current_player]); printf ("The category is %s\n", current_category (game)); ask_question (game); } else { printf ("%s is not getting out of the penalty box\n", game->players[game->current_player]); game->is_getting_out_of_penalty_box = false; } } else { game->places[game->current_player] = game->places[game->current_player] + roll; if (game->places[game->current_player] > 11) game->places[game->current_player] = game->places[game->current_player] - 12; printf ("%s's new location is %d\n", game->players[game->current_player], game->places[game->current_player]); printf ("The category is %s\n", current_category (game)); ask_question (game); } }
void ask_question (struct Game *game) { if (!strcmp (current_category (game), "Pop")) { printf ("%s\n", *(++game->pop_question)); } if (!strcmp (current_category (game), "Science")) { printf ("%s\n", *(++game->science_question)); } if (!strcmp (current_category (game), "Sports")) { printf ("%s\n", *(++game->sports_question)); } if (!strcmp (current_category (game), "Rock")) { printf ("%s\n", *(++game->rock_question)); } }
void ask_question ( void ) { if (!strcmp (current_category (), "Pop")) { printf ("%s\n", *(++pop_question)); } if (!strcmp (current_category (), "Science")) { printf ("%s\n", *(++science_question)); } if (!strcmp (current_category (), "Sports")) { printf ("%s\n", *(++sports_question)); } if (!strcmp (current_category (), "Rock")) { printf ("%s\n", *(++rock_question)); } }