-
Notifications
You must be signed in to change notification settings - Fork 0
/
moves.c
34 lines (31 loc) · 1.24 KB
/
moves.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* moves.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfebvay <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/02/03 05:40:02 by mfebvay #+# #+# */
/* Updated: 2015/02/03 05:45:12 by mfebvay ### ########.fr */
/* */
/* ************************************************************************** */
#include "pushswap.h"
void add_move(char *str, t_list **moves)
{
ft_lstpushback(moves, ft_lstnew(str, (ft_strlen(str) + 1) * sizeof(char)));
}
void put_moves(t_list *moves)
{
if (moves)
{
ft_putstr((char*)moves->content);
moves = moves->next;
while (moves)
{
ft_putchar(' ');
ft_putstr((char*)moves->content);
moves = moves->next;
}
ft_putchar('\n');
}
}