void start_playing(int *game, t_opt *options) { int remain; remain = line_left(game, options); if (options->turn == 1) while (remain != 0) { player(game, options); remain = line_left(game, options); if (remain != 0) computer(game, options); remain = line_left(game, options); if (remain != 0) aff_game(game, options); } else while (remain != 0) { computer(game, options); remain = line_left(game, options); if (remain != 0) player(game, options); remain = line_left(game, options); if (remain != 0) aff_game(game, options); } }
void game(t_opt *options) { int *game; game = xmalloc(options->nblines); game = create_game(options); aff_game(game, options); start_playing(game, options); credits(options); }
int main(int ac, char **av) { t_prog_base base; if (!test_arg(ac, av)) { my_putstr("First argument is not a number.\n", 1); return (0); } init_base(&base, ac, av); print_screen(&base); (base.difficulty != 200) ? aff_game(&base) : ia_vs_ia(&base); free_base(&base); return (0); }