New version

This commit is contained in:
Manzovince
2019-04-14 17:30:46 +02:00
parent b4c1857d88
commit f87832a631
4 changed files with 10 additions and 10 deletions

BIN
fillit Executable file

Binary file not shown.

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */ /* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */ /* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */
/* Updated: 2019/04/14 12:34:30 by vmanzoni ### ########.fr */ /* Updated: 2019/04/14 17:29:58 by vmanzoni ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -20,7 +20,7 @@
#include <stdio.h> // for debug printf #include <stdio.h> // for debug printf
#include <stdbool.h> // to use bool type #include <stdbool.h> // to use bool type
# define BUFFER_SIZE 1024 # define BUFF_SIZE 1024
/* /*
** DELETE BEFORE EVALUATION ** DELETE BEFORE EVALUATION
@@ -33,7 +33,7 @@ void print_test(char *test);
*/ */
char *read_file(char *file); char *read_file(char *file);
void ft_display_error(char *s, int fd); void print_error(char *s);
int ft_file_errors(char *file); int ft_file_errors(char *file);
#endif #endif

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */ /* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */ /* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */
/* Updated: 2019/04/14 14:16:01 by vmanzoni ### ########.fr */ /* Updated: 2019/04/14 17:30:30 by vmanzoni ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -16,9 +16,9 @@
** Function that display error message *s on fd ** Function that display error message *s on fd
*/ */
void ft_display_error(char *s, int fd) void print_error(char *s, int fd)
{ {
write(fd, s, strlen(s)); write(2, s, strlen(s));
} }
/* /*

View File

@@ -6,7 +6,7 @@
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */ /* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/02/12 13:20:48 by vmanzoni #+# #+# */ /* Created: 2019/02/12 13:20:48 by vmanzoni #+# #+# */
/* Updated: 2019/04/14 14:17:22 by vmanzoni ### ########.fr */ /* Updated: 2019/04/14 17:30:14 by vmanzoni ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -19,9 +19,9 @@ int main(int argc, char **argv)
if (argc == 2) if (argc == 2)
{ {
if (!(input = read_file(argv[1]))) if (!(input = read_file(argv[1])))
ft_display_error("Error: Could not read file.\n", 2); ft_display_error("Error: Could not read file.\n");
if (ft_file_errors(input)) if (ft_file_errors(input))
ft_display_error("Error: Invalid file.\n", 2); ft_display_error("Error: Invalid file.\n");
/* /*
Check if every tetrimino is valid Check if every tetrimino is valid
Transform input to tetriminos Transform input to tetriminos
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
*/ */
} }
else else
ft_display_error("Error: Please submit a file.\n", 2); ft_display_error("Error: Please submit a file.\n");
return (0); return (0);
print_test(input); print_test(input);
} }