Beispiel #1
0
void		push_swap(t_dbl **a, t_dbl **b, t_option option,
	t_dbllist **lstactions)
{
	int		i;
	int		nb_push;

	nb_push = 0;
	while (!list_rev_ok(*a))
	{
		action_pile_a(a, i, lstactions);
		if (!list_rev_ok(*a))
		{
			ft_push_pile(a, b);
			ft_lstdbladd(lstactions, "pb", 3);
			nb_push++;
		}
		if (option.v)
		{
			if (option.c)
				ft_affiche_color(*a, *b, 0);
			else
				ft_affiche(*a, *b);
		}
	}
	action_pile_b(a, b, nb_push, lstactions);
}
Beispiel #2
0
void		push_swap2(t_dbl **a, t_dbl **b, t_option option,
	t_dbllist **lstactions)
{
	int		i;

	while ((*b)->length != 0)
	{
		action_fusion(b, i, lstactions);
		ft_push_pile(b, a);
		ft_lstdbladd(lstactions, "pa", 3);
		push_swap(a, b, option, lstactions);
		if (option.v)
		{
			if (option.c)
				ft_affiche_color(*a, *b, 0);
			else
				ft_affiche(*a, *b);
		}
	}
}
Beispiel #3
0
void	ft_print_comb2(void)
{
    int i[2];

    i[0] = 0;

    while(i[0] < 99)
    {
        i[1] = 0;
        while(i[1] <= 99)
        {
            if (i[0] < i[1])
            {
                ft_affiche(i[0],i[1]);
            }
            i[1]++;
        }
        i[0]++;
    }
}