-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_modife.c
58 lines (52 loc) · 1.51 KB
/
ft_modife.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_modife.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bel-bouz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/14 16:41:50 by bel-bouz #+# #+# */
/* Updated: 2019/01/14 16:41:52 by bel-bouz ### ########.fr */
/* */
/* ************************************************************************** */
#include "swap.h"
void inisia(t_var *var)
{
var->lena = 0;
var->lenb = 0;
var->len_a = &var->lena;
var->len_b = &var->lenb;
var->i = 1;
}
void inisia_push(t_var *var)
{
var->lena = 0;
var->lenb = 0;
var->len_a = &var->lena;
var->len_b = &var->lenb;
var->i = 1;
var->nb = 0;
}
void free_lst(t_pile **pile, int len)
{
t_pile *last;
last = *pile;
while (len > 0)
{
free(*pile);
*pile = (*pile)->prec;
len--;
}
}
int calcu_interva(int lena)
{
if (lena < 30)
return (0);
else if (lena > 90 && lena < 120)
return (15);
else if (lena < 90 && lena > 15)
return (20);
else if (lena > 90)
return (50);
return (0);
}