-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme
More file actions
73 lines (56 loc) · 2.29 KB
/
readme
File metadata and controls
73 lines (56 loc) · 2.29 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Documentation for my push_swap project.
Test compiletion command:
gcc -Wall -Wextra -Werror sa.c sb.c ss.c pa.c pb.c ra.c rb.c rr.c rra.c rrb.c rrr.c push_swap.c check_args.c initialization.c validation.c easysort.c valid_sign.c sign_massive.c ../includes/ps.h ../libft.a
ps.h
Included header file;
Contains structures and protipes of all functions;
push_swap.c
Get agruments from command prompt.
If quantity of ARGS > 1, then
Call function check_args()
and waiting '1' back. (If it's KO, print "Error");
Call function initialisation();
Call function validation();
If quantity of ARGS < 8, then
Call function easysort() and finish;
Else
Call function ft_qsort for sorting <vari->sorted[]>;
Validate of <vari->base_n> (mediana);
Call function valid_sing() for make signed massive if INTs;
initialization.c
Initialize all variables with '0' or NULL;
validation.c
Allocate memory for 3 massives of INTs
and check it. (if it's KO, finish);
Write allocated memory with '0';
Call function ft_atoi() to write ARGS in <vari->stk_a>,
and if ARGS > 4 to duplicate it in <vari->sorted>;
easysort.c
If size of STK_A > 3, then
Call function cut_sort():
Call function ft_qsort for sorting <vari->sorted[]>;
Validate of <vari->base_n> (mediana);
Movein STK_B all numbers less then <vari->base_n>
Call function a_sort():
If size of STK_A == 3, then
Sort 3 elements in STK_A with functions rra(), sa(), ra();
Else
Sort 2 elements with function sa();
Call function b_sort():
If size of STK_B == 3, then
Sort 3 elements in STK_B with functions rrb(), sb(), rb();
Else
Sort 2 elements with function sb();
Else
Call function a_sort(); (look description upper)
valid_sign.c
Allocate memory for 2 massives of structures with signrd elements
and check if it's OK;
Write allocated memory with '0';
Call function sign_massive();
sing_massive.c
Copy INTs from STK_A to structure;
Sign how much moves to the top throw up;
Sign how much moves to the top throw down;
Sign true possition in sorted stack.
gcc -Wall -Wextra -Werror sa.c sb.c ss.c pa.c pb.c ra.c rb.c rr.c rra.c rrb.c rrr.c push_swap.c check_args.c initialization.c validation.c easysort.c valid_sign.c sign_massive.c cut_a.c ../includes/ps.h ../libft.a a_sort.c b_sort.c valid_pos.c put_on_place.c