TP11 exo2: Add basics UI functions and integrate them is the static and
[TD_C.git] / TP_11 / exo2 / exo2.c
1 #include <stdio.h>
2
3 #include "clist.h"
4 #include "ui.h"
5
6 int main() {
7 link_t* head1 = NULL;
8 link_t* head2 = NULL;
9 link_t* head = NULL;
10
11 printf("Longueur de la liste: %d\n", list_count(head1));
12 head1 = list_append(head1, 1);
13 head1 = list_append(head1, 2);
14 head1 = list_append(head1, 3);
15 head1 = list_append(head1, 4);
16 printf("Longueur de la liste: %d\n", list_count(head1));
17 displayList(head1);
18 head1 = list_prepend(head1, 5);
19 printf("Longueur de la liste: %d\n", list_count(head1));
20 displayList(head1);
21 list_set(head1, 0, 78);
22 displayList(head1);
23 head1 = list_insert(head1, 2, 7);
24 displayList(head1);
25 head1 = list_delete(head1, 3);
26 displayList(head1);
27 head1 = list_append(head1, 5);
28 head1 = list_append(head1, 12);
29 head1 = list_append(head1, 65);
30 head1 = list_append(head1, 21);
31 head1 = list_sort(head1);
32 displayList(head1);
33 head2 = list_insert(head2, 0, 8);
34 head2 = list_append(head2, 6);
35 head2 = list_prepend(head2, 5);
36 displayList(head2);
37 head = list_concat(head1, head2);
38 displayList(head);
39 head = list_merge_sort(head);
40 //head = list_sort(head);
41 displayList(head);
42 //list_clear(head1);
43 //list_clear(head2);
44 list_clear(head);
45
46 return 0;
47 }