...seems ok this time ^^"
corrected stack checker in checker
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/02/23 13:35:15 by tmaze #+# #+# */
|
||||
/* Updated: 2019/03/17 17:24:43 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/03/18 12:28:54 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -46,7 +46,7 @@ void exec_actions(t_psdata *data)
|
||||
nop = data->op;
|
||||
while (nop && (buff = (char*)nop->content))
|
||||
{
|
||||
if (ft_strcmp(buff, "rra") == 0 || ft_strcmp(buff, "rrn") == 0)
|
||||
if (ft_strcmp(buff, "rra") == 0 || ft_strcmp(buff, "rrb") == 0)
|
||||
ps_rerot(data, buff[2]);
|
||||
else if (ft_strcmp(buff, "rrr") == 0)
|
||||
ps_rrerot(data);
|
||||
@@ -98,9 +98,10 @@ void check_stack(t_psdata *data)
|
||||
int nb;
|
||||
|
||||
ind = data->a;
|
||||
if (ind)
|
||||
nb = ind->nb;
|
||||
while (ind)
|
||||
{
|
||||
nb = ind->nb;
|
||||
if (ind->nb < nb || data->size_b > 0)
|
||||
{
|
||||
ft_putendl("KO");
|
||||
@@ -111,6 +112,8 @@ void check_stack(t_psdata *data)
|
||||
}
|
||||
if (!ind && data->size_b == 0)
|
||||
ft_putendl("OK");
|
||||
else
|
||||
ft_putendl("KO");
|
||||
}
|
||||
|
||||
int main(int ac, char **av)
|
||||
|
Reference in New Issue
Block a user