v0.1 parse_input

Not tested
This commit is contained in:
Manzovince
2019-04-14 18:55:27 +02:00
parent 1d244568dc
commit 5d6b2b0db3
2 changed files with 57 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */
/* Updated: 2019/04/14 17:53:24 by vmanzoni ### ########.fr */
/* Updated: 2019/04/14 18:40:49 by vmanzoni ### ########.fr */
/* */
/* ************************************************************************** */
@@ -49,3 +49,41 @@ int check_file_errors(char *file)
return (1);
return (0);
}
int check_tetri_errors(char *tetri)
{
int i;
int htg;
int dot;
i = 0;
htg = 0;
dot = 0;
while (tetri[i])
{
if (tetri[i] = '#')
htg++;
else if (tetri[i] = '.')
dot++;
}
if (htg != 4 || dot != 12 || check_tetri_errors2(tetri))
return (1);
return (0);
}
/*
int check_tetri_errors2(char *tetri)
{
int i;
i = 0;
while (tetri[i])
{
if (tetri[i] == '#')
{
}
}
return (0);
}
*/

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/13 12:09:46 by vmanzoni #+# #+# */
/* Updated: 2019/04/14 18:03:20 by vmanzoni ### ########.fr */
/* Updated: 2019/04/14 18:54:53 by vmanzoni ### ########.fr */
/* */
/* ************************************************************************** */
@@ -46,19 +46,26 @@ char *read_file(char *file)
int parse_input(char *input)
{
int i;
int j;
int nl;
char /*NOM DE LA VARIABLE*/;
int c;
int i;
int j;
i = 0;
nl = 0;
while (input[i])
c = 0;
while (input[c])
{
j = 0;
while (j != 4)
i = 0;
while (i < 4)
{
square[j][] =
j++;
j = 0;
while (j < 4)
{
/*NOM DE LA VARIABLE[j]*/ = input[c++];
j++;
}
c++;
i++;
}
c++;
}
}