Ejemplo n.º 1
0
int		ft_check_case(int x, int y, struct s_grid *grid)
{
	if (ft_check_line(grid->lines[y]) && ft_check_column(grid->columns[x])
		&& ft_check_block(grid->blocks[ft_get_block_of(x, y)]) == 1)
		return (1);
	else
		return (0);
}
Ejemplo n.º 2
0
int		ft_new_number(int n, int pos, char tab[9][9])
{
	while (n++ <= 9)
	{
		if (ft_check_line(n, pos, tab) == 0 &&
				ft_check_col(n, pos, tab) == 0 &&
				ft_check_block(n, pos, tab) == 0)
		{
			tab[pos / 9][pos % 9] = n;
			return (1);
		}
	}
	return (0);
}