示例#1
0
文件: game.c 项目: chypriote/allum1
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);
      }
}
示例#2
0
文件: game.c 项目: chypriote/allum1
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);
}
示例#3
0
文件: main.c 项目: plean/CPE
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);
}