merging to push test bits
This commit is contained in:
Binary file not shown.
Binary file not shown.
12
Makefile
12
Makefile
@@ -6,18 +6,18 @@
|
|||||||
# By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ #
|
# By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ #
|
||||||
# +#+#+#+#+#+ +#+ #
|
# +#+#+#+#+#+ +#+ #
|
||||||
# Created: 2019/03/01 13:24:35 by vmanzoni #+# #+# #
|
# Created: 2019/03/01 13:24:35 by vmanzoni #+# #+# #
|
||||||
# Updated: 2019/04/16 14:05:39 by hulamy ### ########.fr #
|
# Updated: 2019/04/16 16:39:00 by vmanzoni ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
NAME = fillit
|
NAME = fillit
|
||||||
|
|
||||||
OBJ_DIR = ./
|
OBJ_DIR = objs./
|
||||||
HEADER = ./
|
HEADER = fillit.h
|
||||||
|
|
||||||
SRCS = *.c
|
SRCS = *.c
|
||||||
OBJS = $(SRCS:.c=.o)
|
OBJS = $(SRCS:.c=.o)
|
||||||
LIB = fillit.h
|
LIB = libft/
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -Wall -Werror -Wextra
|
CFLAGS = -Wall -Werror -Wextra
|
||||||
@@ -29,9 +29,7 @@ all: $(NAME)
|
|||||||
$(NAME):
|
$(NAME):
|
||||||
make -C libft/
|
make -C libft/
|
||||||
$(CC) $(CFLAGS) -I$(HEADER) -c $(SRCS)
|
$(CC) $(CFLAGS) -I$(HEADER) -c $(SRCS)
|
||||||
$(CC) -o $(NAME) $(OBJS) -L libft/ -lft
|
$(CC) -o $(NAME) $(OBJS) -L $(LIB) -lft
|
||||||
#$(CC) $(CFLAGS) -I$(HEADER) -c $(addprefix $(SRC_DIR), $(SRCS))
|
|
||||||
#$(CC) $(OBJS) -o $(NAME)
|
|
||||||
mkdir $(OBJ_DIR)
|
mkdir $(OBJ_DIR)
|
||||||
mv $(OBJS) $(OBJ_DIR)
|
mv $(OBJS) $(OBJ_DIR)
|
||||||
|
|
||||||
|
|||||||
4
main.c
4
main.c
@@ -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/15 20:54:24 by vmanzoni ### ########.fr */
|
/* Updated: 2019/04/16 16:41:28 by vmanzoni ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -24,12 +24,10 @@ int main(int argc, char **argv)
|
|||||||
print_error("Error: Invalid file.\n");
|
print_error("Error: Invalid file.\n");
|
||||||
parse_input(input);
|
parse_input(input);
|
||||||
/*
|
/*
|
||||||
Transform input to tetriminos
|
|
||||||
Backtracking for smallest square
|
Backtracking for smallest square
|
||||||
Transform tetriminos with letters
|
Transform tetriminos with letters
|
||||||
Print result
|
Print result
|
||||||
*/
|
*/
|
||||||
//print_test(input);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
print_error("Usage: Please submit a file.\n");
|
print_error("Usage: Please submit a file.\n");
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2019/04/15 14:48:14 by vmanzoni #+# #+# */
|
/* Created: 2019/04/15 14:48:14 by vmanzoni #+# #+# */
|
||||||
/* Updated: 2019/04/16 15:28:11 by hulamy ### ########.fr */
|
/* Updated: 2019/04/16 16:19:55 by vmanzoni ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -34,7 +34,6 @@ char **create_square(char *tetri)
|
|||||||
square[i][k] = *(tetri++);
|
square[i][k] = *(tetri++);
|
||||||
while (*tetri == '\n')
|
while (*tetri == '\n')
|
||||||
tetri++;
|
tetri++;
|
||||||
// printf("%s\n", square[i]);
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
return (square);
|
return (square);
|
||||||
@@ -55,7 +54,6 @@ void parse_input(char *input)
|
|||||||
while (j < 19)
|
while (j < 19)
|
||||||
tetri[j++] = input[i++];
|
tetri[j++] = input[i++];
|
||||||
tetri[19] = '\0';
|
tetri[19] = '\0';
|
||||||
//printf("PRINT:\n%s\n", tetri);
|
|
||||||
if (check_tetri_errors(tetri))
|
if (check_tetri_errors(tetri))
|
||||||
print_error("Error: Tetrimino not valid.");
|
print_error("Error: Tetrimino not valid.");
|
||||||
test = create_square(tetri);
|
test = create_square(tetri);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2019/03/01 13:35:48 by vmanzoni #+# #+# */
|
/* Created: 2019/03/01 13:35:48 by vmanzoni #+# #+# */
|
||||||
/* Updated: 2019/04/15 00:11:22 by hulamy ### ########.fr */
|
/* Updated: 2019/04/16 16:41:46 by vmanzoni ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -18,8 +18,3 @@ void ft_print_fillit()
|
|||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void print_test(char *test)
|
|
||||||
{
|
|
||||||
write(1, test, strlen(test));
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user