editing few files for readability

This commit is contained in:
Manzovince
2019-04-23 16:17:13 +02:00
parent acf5aed90e
commit 21c10a5787
3 changed files with 69 additions and 73 deletions

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/15 14:48:14 by vmanzoni #+# #+# */
/* Updated: 2019/04/23 15:24:46 by vmanzoni ### ########.fr */
/* Updated: 2019/04/23 16:01:12 by vmanzoni ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,43 @@
/*
** Function that parse a file and put each tetrimino in a linked list
*/
void parse_input(char *input)
{
static t_fillist *list = NULL;
char tetri[20];
int i;
int j;
i = 0;
printf("%s", input);
while (input[i])
{
j = 0;
while (j < 19)
tetri[j++] = input[i++];
tetri[19] = '\0';
if (check_tetri_errors(tetri))
print_error("Error: Tetrimino not valid.");
add_to_list(tetri, &list);
while (input[i] && input[i] != '.' && input[i] != '#')
i++;
}
/*DEBUG PART - Print each tetribit*/
/*
while (list != NULL)
{
printf("%i\n", list->tetribit);
printf("\n");
list = list->next;
}
*/
}
/*
** DELETE BEFORE EVAL - NOT USED ANYMORE
** Function that parse a file and put each tetrimino in a linked list
*/
char **create_square(char *tetri)
@@ -40,43 +76,3 @@ char **create_square(char *tetri)
}
return (square);
}
/*
** Function that parse a file and put each tetrimino in a linked list
*/
void parse_input(char *input)
{
static t_fillist *list = NULL;
char tetri[20];
int i;
int j;
i = 0;
while (input[i])
{
j = 0;
while (j < 19)
tetri[j++] = input[i++];
tetri[19] = '\0';
printf("%s\n", tetri);
if (check_tetri_errors(tetri))
print_error("Error: Tetrimino not valid.");
add_to_list(tetri, &list);
while (input[i] == '\n')
i++;
}
/*
** ce qui suit sert juste a afficher le contenu de tous les tetraminos de la liste chainee
** pour debug, a effacer au rendu
*/
/*
while (list && (i = -1))
{
while (++i < list->size[1])
printf("%s\n", list->tetraminos[i]);
printf("\n");
list = list->next;
}
*/
}