-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions_1.c
45 lines (40 loc) · 1.25 KB
/
functions_1.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* functions_1.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gmelisan <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/09/13 16:16:07 by gmelisan #+# #+# */
/* Updated: 2018/09/13 18:18:58 by gmelisan ### ########.fr */
/* */
/* ************************************************************************** */
#include "bf.h"
int inc_pointer(void)
{
if (g_pointer < ARR_SIZE - 1)
{
g_pointer++;
return (1);
}
return (0);
}
int dec_pointer(void)
{
if (g_pointer > 0)
{
g_pointer--;
return (1);
}
return (0);
}
void inc_byte(char *array)
{
if ((int)array[g_pointer] < 255)
array[g_pointer]++;
}
void dec_byte(char *array)
{
if (array[g_pointer] > 0)
array[g_pointer]--;
}