コード例 #1
0
ファイル: pause_screen.c プロジェクト: ubertil/my_projects
void		init_pause(t_tetris *game)
{
  game->pause_screen = subwin(stdscr, 7, 34, (LINES / 2) - 3, (COLS / 2) - 17);
  wborder(game->pause_screen, '|', '|', '-', '-', '/', '\\', '\\', '/');
  put_spaces((COLS / 2) - 16, (LINES / 2) - 2,
	     (COLS / 2) + 16, (LINES / 2) + 3);
  mvprintw((LINES / 2), (COLS / 2) - 7, "Game Paused");
  wrefresh(game->pause_screen);
  game->pause = 0;
}
コード例 #2
0
ファイル: attr2.c プロジェクト: brozorec/ft_ls
void		file_devices(long dev)
{
	int			siz;
	int			i;

	i = 2;
	while (i > 0)
	{
		ft_putchar(' ');
		i--;
	}
	siz = ft_getsize_nbr(major(dev));
	i = 3 - siz;
	put_spaces(i);
	ft_putnbr(major(dev));
	ft_putstr(",");
	siz = ft_getsize_nbr(minor(dev));
	i = 4 - siz;
	put_spaces(i);
	ft_putnbr(minor(dev));
	ft_putchar(' ');
}
コード例 #3
0
int main(int argc, char *argv[])
{
	char *ln, *b, *s;

	input = stdin;
	output = stdout;

	if (argc > 1)
		input = fopen(argv[1], "r");
	if (argc > 2)
		output = fopen(argv[2], "w");

	if (!input || !output) {
		fprintf(stderr, "could not open files\n");
		abort();
	}

	if (input == stdin || output == stdout)
		fprintf(stderr, "WARNING: using debug mode behavior\n");

	for (;;) {
		if ((ln = get_line()) == NULL)
			break;
		if (ln[0] == '=')
			break;

		b = ln;
		while (*b != '=') b++;
		*b++ = '\0';

		s = b;
		while (*s && *s != '\n') s++;
		*s = '\0';
		
		printf("%d\n", count_eq(put_spaces(ln), put_spaces(b)));
	}
}