Beispiel #1
0
void	find_type(char *str, int row, int col)
{
	int count;

	count = 0;
	if (ft_strcmp(str, rush00(col, row)) == 0)
		display(row, col, 0, count++);
	if (ft_strcmp(str, rush01(col, row)) == 0)
		display(row, col, 1, count++);
	if (ft_strcmp(str, rush02(col, row)) == 0)
		display(row, col, 2, count++);
	if (ft_strcmp(str, rush03(col, row)) == 0)
		display(row, col, 3, count++);
	if (ft_strcmp(str, rush04(col, row)) == 0)
		display(row, col, 4, count++);
	if (count == 0)
		ft_putstr("aucune");
}
void	ft_displayresult(char *c, int wd, int ht, int i)
{
	int status;

	status = 0;
	while (i <= 4)
	{
		if (ft_strcmp(c, rush00(0, 0, wd, ht)) == 0 && i == 0)
			status = ft_prtresult("rush-00", wd, ht, status);
		if (ft_strcmp(c, rush01(0, 0, wd, ht)) == 0 && i == 1)
			status = ft_prtresult("rush-01", wd, ht, status);
		if (ft_strcmp(c, rush02(0, 0, wd, ht)) == 0 && i == 2)
			status = ft_prtresult("rush-02", wd, ht, status);
		if (ft_strcmp(c, rush03(0, 0, wd, ht)) == 0 && i == 3)
			status = ft_prtresult("rush-03", wd, ht, status);
		if (ft_strcmp(c, rush04(0, 0, wd, ht)) == 0 && i == 4)
			status = ft_prtresult("rush-04", wd, ht, status);
		i++;
	}
	if (status != 0)
		ft_putchar('\n');
}