-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecide_force.c
More file actions
60 lines (57 loc) · 1.82 KB
/
Copy pathdecide_force.c
File metadata and controls
60 lines (57 loc) · 1.82 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* decide_force.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tyassine <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/04/07 10:05:10 by tyassine #+# #+# */
/* Updated: 2016/04/07 10:05:16 by tyassine ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
void decide_force_left(t_form *info, t_data *d)
{
if (info->force && info->left)
{
if (d->type == 'p' && info->prec)
{
ft_putchar(d->string[info->nega++]);
ft_putchar(d->string[info->nega++]);
}
else if (d->type == 'o' || d->type == 'O')
{
ft_putchar(d->string[info->nega++]);
}
else if (d->type == 'x' || d->type == 'X')
{
ft_putchar(d->string[info->nega++]);
ft_putchar(d->string[info->nega++]);
}
}
}
void decide_force(t_form *info, t_data *d)
{
if (d->tmp != -92)
{
if (!info->left && info->force)
{
if (d->type == 'o' || d->type == 'O')
{
ft_putchar(d->string[info->nega++]);
}
else if (d->type == 'x' || d->type == 'X')
{
ft_putchar(d->string[info->nega++]);
ft_putchar(d->string[info->nega++]);
}
else if (d->type == 'p')
{
ft_putchar(d->string[info->nega++]);
ft_putchar(d->string[info->nega++]);
}
}
decide_force_left(info, d);
d->tmp = -92;
}
}