From c81b7515bebfce7426e97690d655f1da7589f9e0 Mon Sep 17 00:00:00 2001 From: Hugo LAMY Date: Sat, 1 Jun 2019 15:58:31 +0200 Subject: [PATCH] clean pour merge --- .gitignore | 19 - Makefile | 55 --- README.md | 24 -- author | 2 - f_bonus_opti.c | 100 ----- f_bonus_print.c | 76 ---- f_handle_errors.c | 133 ------ f_parse_input.c | 156 ------- f_print.c | 121 ------ f_print_map_with_colors.c | 56 --- f_read_file.c | 38 -- f_search_map.c | 167 -------- fillit.dSYM/Contents/Info.plist | 20 - fillit.h | 150 ------- main.c | 113 ------ samples/16square | 79 ---- samples/1full | 4 - samples/1square | 4 - samples/1tetri | 4 - samples/1tetri_T | 4 - samples/1tetri_wrong | 4 - samples/26square | 129 ------ samples/26tetri | 129 ------ samples/27tetri | 134 ------ samples/2nl | 10 - samples/2tetri | 9 - samples/3tetri | 14 - samples/3tetribis | 14 - samples/42 | 4 - samples/4square | 19 - samples/4tetri | 19 - samples/4tetribis | 19 - samples/5square | 24 -- samples/9square | 44 -- samples/Non_valide | 19 - samples/backslash_0 | Bin 20 -> 0 bytes samples/bad_test | 4 - samples/debug/jdugoudr | 89 ---- samples/debug/jdugoudr1 | 84 ---- samples/debug/jdugoudr10 | 84 ---- samples/debug/jdugoudr11 | 84 ---- samples/debug/jdugoudr12 | 84 ---- samples/debug/jdugoudr13 | 84 ---- samples/debug/jdugoudr14 | 84 ---- samples/debug/jdugoudr15 | 84 ---- samples/debug/jdugoudr16 | 84 ---- samples/debug/jdugoudr17 | 84 ---- samples/debug/jdugoudr18 | 79 ---- samples/debug/jdugoudr18_17 | 79 ---- samples/debug/jdugoudr18_17_16 | 74 ---- samples/debug/jdugoudr18_17_16_15 | 69 ---- samples/debug/jdugoudr18_17_16_15_14 | 64 --- samples/debug/jdugoudr18_17_16_15_14_13 | 59 --- samples/debug/jdugoudr18_17_16_15_14_13_12 | 54 --- samples/debug/jdugoudr18_17_16_15_14_13_12_11 | 49 --- .../debug/jdugoudr18_17_16_15_14_13_12_11_10 | 44 -- samples/debug/jdugoudr1_10 | 79 ---- samples/debug/jdugoudr1_11 | 79 ---- samples/debug/jdugoudr1_12 | 79 ---- samples/debug/jdugoudr1_13 | 79 ---- samples/debug/jdugoudr1_14 | 79 ---- samples/debug/jdugoudr1_15 | 79 ---- samples/debug/jdugoudr1_16 | 79 ---- samples/debug/jdugoudr1_17 | 79 ---- samples/debug/jdugoudr1_18 | 79 ---- samples/debug/jdugoudr1_2 | 79 ---- samples/debug/jdugoudr1_2_3 | 74 ---- samples/debug/jdugoudr1_2_3_4 | 69 ---- samples/debug/jdugoudr1_2_3_4_5 | 64 --- samples/debug/jdugoudr1_2_3_4_5_6 | 59 --- samples/debug/jdugoudr1_2_3_4_5_6_7 | 54 --- samples/debug/jdugoudr1_2_3_4_5_6_7_8 | 49 --- samples/debug/jdugoudr1_2_3_4_5_6_7_8_9 | 44 -- samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10 | 39 -- samples/debug/jdugoudr1_3 | 79 ---- samples/debug/jdugoudr1_4 | 79 ---- samples/debug/jdugoudr1_5 | 79 ---- samples/debug/jdugoudr1_6 | 79 ---- samples/debug/jdugoudr1_7 | 79 ---- samples/debug/jdugoudr1_8 | 79 ---- samples/debug/jdugoudr1_9 | 79 ---- samples/debug/jdugoudr2 | 84 ---- samples/debug/jdugoudr3 | 84 ---- samples/debug/jdugoudr4 | 84 ---- samples/debug/jdugoudr5 | 84 ---- samples/debug/jdugoudr6 | 84 ---- samples/debug/jdugoudr7 | 84 ---- samples/debug/jdugoudr8 | 84 ---- samples/debug/jdugoudr9 | 84 ---- samples/difficile | 114 ------ samples/difficile_ou_pas | 114 ------ samples/empty | 0 samples/error1 | 8 - samples/error2 | 9 - samples/full | 19 - samples/invalid_sample | 20 - samples/map_hard | 49 --- samples/map_slack | 99 ----- samples/newline | 1 - samples/opti_test | 14 - samples/sujet_1 | 19 - samples/sujet_2 | 39 -- samples/test | 4 - samples/test7 | 34 -- samples/test_11 | 54 --- samples/test_8 | 39 -- samples/test_a | 19 - samples/test_bug | 4 - samples/test_opti | 19 - samples/test_ultra_lent | 99 ----- samples/tetri_wrong | 124 ------ samples/two | 4 - samples/valid_sample | 19 - samples/valid_sample_with_newline | 20 - test_files/test_add_to_list.c | 95 ----- test_files/test_big_map.c | 105 ----- test_files/test_big_tetri.c | 125 ------ test_files/test_get_smallest_square.c | 35 -- test_files/test_mask.c | 92 ----- test_files/test_othermethod_fillit.c | 266 ------------ test_files/test_print_fillit.c | 20 - test_files/test_search_map2.c | 382 ------------------ 122 files changed, 7867 deletions(-) delete mode 100644 .gitignore delete mode 100644 Makefile delete mode 100644 README.md delete mode 100644 author delete mode 100644 f_bonus_opti.c delete mode 100644 f_bonus_print.c delete mode 100644 f_handle_errors.c delete mode 100644 f_parse_input.c delete mode 100644 f_print.c delete mode 100644 f_print_map_with_colors.c delete mode 100644 f_read_file.c delete mode 100644 f_search_map.c delete mode 100644 fillit.dSYM/Contents/Info.plist delete mode 100644 fillit.h delete mode 100644 main.c delete mode 100644 samples/16square delete mode 100644 samples/1full delete mode 100644 samples/1square delete mode 100644 samples/1tetri delete mode 100644 samples/1tetri_T delete mode 100644 samples/1tetri_wrong delete mode 100644 samples/26square delete mode 100644 samples/26tetri delete mode 100644 samples/27tetri delete mode 100644 samples/2nl delete mode 100644 samples/2tetri delete mode 100644 samples/3tetri delete mode 100644 samples/3tetribis delete mode 100644 samples/42 delete mode 100644 samples/4square delete mode 100644 samples/4tetri delete mode 100644 samples/4tetribis delete mode 100644 samples/5square delete mode 100644 samples/9square delete mode 100644 samples/Non_valide delete mode 100644 samples/backslash_0 delete mode 100644 samples/bad_test delete mode 100644 samples/debug/jdugoudr delete mode 100644 samples/debug/jdugoudr1 delete mode 100644 samples/debug/jdugoudr10 delete mode 100644 samples/debug/jdugoudr11 delete mode 100644 samples/debug/jdugoudr12 delete mode 100644 samples/debug/jdugoudr13 delete mode 100644 samples/debug/jdugoudr14 delete mode 100644 samples/debug/jdugoudr15 delete mode 100644 samples/debug/jdugoudr16 delete mode 100644 samples/debug/jdugoudr17 delete mode 100644 samples/debug/jdugoudr18 delete mode 100644 samples/debug/jdugoudr18_17 delete mode 100644 samples/debug/jdugoudr18_17_16 delete mode 100644 samples/debug/jdugoudr18_17_16_15 delete mode 100644 samples/debug/jdugoudr18_17_16_15_14 delete mode 100644 samples/debug/jdugoudr18_17_16_15_14_13 delete mode 100644 samples/debug/jdugoudr18_17_16_15_14_13_12 delete mode 100644 samples/debug/jdugoudr18_17_16_15_14_13_12_11 delete mode 100644 samples/debug/jdugoudr18_17_16_15_14_13_12_11_10 delete mode 100644 samples/debug/jdugoudr1_10 delete mode 100644 samples/debug/jdugoudr1_11 delete mode 100644 samples/debug/jdugoudr1_12 delete mode 100644 samples/debug/jdugoudr1_13 delete mode 100644 samples/debug/jdugoudr1_14 delete mode 100644 samples/debug/jdugoudr1_15 delete mode 100644 samples/debug/jdugoudr1_16 delete mode 100644 samples/debug/jdugoudr1_17 delete mode 100644 samples/debug/jdugoudr1_18 delete mode 100644 samples/debug/jdugoudr1_2 delete mode 100644 samples/debug/jdugoudr1_2_3 delete mode 100644 samples/debug/jdugoudr1_2_3_4 delete mode 100644 samples/debug/jdugoudr1_2_3_4_5 delete mode 100644 samples/debug/jdugoudr1_2_3_4_5_6 delete mode 100644 samples/debug/jdugoudr1_2_3_4_5_6_7 delete mode 100644 samples/debug/jdugoudr1_2_3_4_5_6_7_8 delete mode 100644 samples/debug/jdugoudr1_2_3_4_5_6_7_8_9 delete mode 100644 samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10 delete mode 100644 samples/debug/jdugoudr1_3 delete mode 100644 samples/debug/jdugoudr1_4 delete mode 100644 samples/debug/jdugoudr1_5 delete mode 100644 samples/debug/jdugoudr1_6 delete mode 100644 samples/debug/jdugoudr1_7 delete mode 100644 samples/debug/jdugoudr1_8 delete mode 100644 samples/debug/jdugoudr1_9 delete mode 100644 samples/debug/jdugoudr2 delete mode 100644 samples/debug/jdugoudr3 delete mode 100644 samples/debug/jdugoudr4 delete mode 100644 samples/debug/jdugoudr5 delete mode 100644 samples/debug/jdugoudr6 delete mode 100644 samples/debug/jdugoudr7 delete mode 100644 samples/debug/jdugoudr8 delete mode 100644 samples/debug/jdugoudr9 delete mode 100644 samples/difficile delete mode 100644 samples/difficile_ou_pas delete mode 100644 samples/empty delete mode 100644 samples/error1 delete mode 100644 samples/error2 delete mode 100644 samples/full delete mode 100644 samples/invalid_sample delete mode 100644 samples/map_hard delete mode 100644 samples/map_slack delete mode 100644 samples/newline delete mode 100644 samples/opti_test delete mode 100644 samples/sujet_1 delete mode 100644 samples/sujet_2 delete mode 100644 samples/test delete mode 100644 samples/test7 delete mode 100644 samples/test_11 delete mode 100644 samples/test_8 delete mode 100644 samples/test_a delete mode 100644 samples/test_bug delete mode 100644 samples/test_opti delete mode 100644 samples/test_ultra_lent delete mode 100644 samples/tetri_wrong delete mode 100644 samples/two delete mode 100644 samples/valid_sample delete mode 100644 samples/valid_sample_with_newline delete mode 100644 test_files/test_add_to_list.c delete mode 100644 test_files/test_big_map.c delete mode 100644 test_files/test_big_tetri.c delete mode 100644 test_files/test_get_smallest_square.c delete mode 100644 test_files/test_mask.c delete mode 100644 test_files/test_othermethod_fillit.c delete mode 100644 test_files/test_print_fillit.c delete mode 100644 test_files/test_search_map2.c diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 00f9052..0000000 --- a/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -objs/ - -*.o - -a\.out\.dSYM/ - -a\.out - -*.swo - -*.swp - -fillit - -test_fillit\.c - -libft - -\.DS_Store diff --git a/Makefile b/Makefile deleted file mode 100644 index 161d981..0000000 --- a/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# **************************************************************************** # -# # -# ::: :::::::: # -# Makefile :+: :+: :+: # -# +:+ +:+ +:+ # -# By: vmanzoni +#+ +:+ +#+ # -# +#+#+#+#+#+ +#+ # -# Created: 2019/03/01 13:24:35 by vmanzoni #+# #+# # -# Updated: 2019/05/29 14:03:03 by vmanzoni ### ########.fr # -# # -# **************************************************************************** # - -# - - - - - - - - - - - - - - - # -# VARIABLES # -# - - - - - - - - - - - - - - - # - -NAME = fillit -CC = gcc - -CFLAGS = -I. -CFLAGS += -Wall -Wextra -Werror - -LDFLAGS = -L./libft/ -LDLIBS = -lft - -SRCS = $(shell find . -depth 1 -type f -not -name '.*' -not -name 'test*' -name '*.c') - -TRASH = $(shell find . -depth 1 -name '*.dSYM') -TRASH += $(shell find . -depth 1 -type f -name '*.o') -TRASH += $(shell find . -depth 1 -type f -name '*.swp') -TRASH += $(shell find . -depth 1 -type f -name '*.swo') -TRASH += $(shell find . -depth 1 -type f -name '*.swn') - -# - - - - - - - - - - - - - - - # -# RULES # -# - - - - - - - - - - - - - - - # - -all: $(NAME) - -$(NAME): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(SRCS) -o $(NAME) - -debug: $(SRCS) - $(CC) -g $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(SRCS) -o $(NAME) - -lib: - make -C ./libft/ - -clean: - /bin/rm -rf $(TRASH) - -fclean: clean - /bin/rm -rf $(NAME) - -re: fclean all diff --git a/README.md b/README.md deleted file mode 100644 index 9e08e03..0000000 --- a/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Fillit - -Team: **hulamy** and **vmanzoni** - -Le but de ce projet est d’agencer les Tetriminos entre eux pour former le plus petit carré possible, sachant que ce carré peut présenter des trous quand les pièces données ne s’emboîtent pas parfaitement. - -## To do - -- [x] Check if we have a file -- [x] Read file -- [x] Check if there are errors in file -- [x] Check if every tetrimino is valid -- [x] Transform file into tetriminos -- [x] Backtracking for smallest square -- [x] Transform tetriminos to letters -- [x] Print result (Can be done with above step) -- [ ] Free everything (NO LEAKS) - -## BONUS -- [x] Best error handler (more details on why there is an error.) -- [x] Optimisation (skip when tetri with same shape was already tested on map) -- [x] Add colors to tetri when printing result map -- [x] Flag for debbuging (print every step in backtracking) -- [x] Adding flags (and password for blocking more args on moulinette) diff --git a/author b/author deleted file mode 100644 index 884dc49..0000000 --- a/author +++ /dev/null @@ -1,2 +0,0 @@ -hulamy -vmanzoni diff --git a/f_bonus_opti.c b/f_bonus_opti.c deleted file mode 100644 index 9406a5b..0000000 --- a/f_bonus_opti.c +++ /dev/null @@ -1,100 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* f_bonus_opti.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/06/01 14:06:37 by hulamy #+# #+# */ -/* Updated: 2019/06/01 14:06:40 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** Test optimisation for not testing wrong maps when tetri are identical -*/ - -int check_tetri_memory(t_fillist *list, int pos) -{ - t_fillist *tetri; - unsigned int mask; - - tetri = list; - mask = 1 << ((pos % 32) - 1); - if (tetri->same) - { - if (!(tetri->same->memory[pos / 32] & mask)) - return (tetri->same->memory[pos / 32] |= mask); - } - else - { - if (!(tetri->memory[pos / 32] & mask)) - return (tetri->memory[pos / 32] |= mask); - } - return (0); -} - -/* -** Test optimisation for not testing wrong maps when tetri are identical -*/ - -int compare_tetri(t_fillist *tetri_a, t_fillist *tetri_b) -{ - if (tetri_a->tetribit != tetri_b->tetribit) - return (0); - if (tetri_a->width != tetri_b->width) - return (0); - if (tetri_a->height != tetri_b->height) - return (0); - return (1); -} - -/* -** Function that free the list->memory each time it's malloc -*/ - -t_fillist *clean_list_memory(t_fillist *list, t_fillist *tmp) -{ - while (tmp) - { - if (tmp->memory) - free(tmp->memory); - tmp = tmp->next; - } - return (list); -} - -/* -** Test optimisation for not testing wrong maps when tetri are identical -*/ - -int check_same_tetri(t_fillist *list, int num) -{ - t_fillist *curr_tetri; - t_fillist *next_tetri; - int i; - - curr_tetri = clean_list_memory(list, list); - while (curr_tetri != NULL) - { - i = 0; - if (!curr_tetri->memory && !(curr_tetri->memory = - (unsigned int *)malloc(sizeof(*curr_tetri->memory) * num))) - return (0); - while (i < num) - curr_tetri->memory[i++] = 0; - next_tetri = curr_tetri->next; - while (next_tetri != NULL) - { - if (compare_tetri(curr_tetri, next_tetri)) - if (next_tetri->same == NULL) - next_tetri->same = curr_tetri; - next_tetri = next_tetri->next; - } - curr_tetri->total_num = num; - curr_tetri = curr_tetri->next; - } - return (1); -} diff --git a/f_bonus_print.c b/f_bonus_print.c deleted file mode 100644 index 0637048..0000000 --- a/f_bonus_print.c +++ /dev/null @@ -1,76 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* f_bonus_print.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/05/27 13:46:29 by hulamy #+# #+# */ -/* Updated: 2019/05/29 18:31:22 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** function that print the given tetris if flag p is present -*/ - -int print_tetri(t_fillist *list, int size) -{ - unsigned int print; - - if (list->dope[2]) - { - while (list && ++size) - { - check_same_tetri(list, 1); - print = list->tetribit; - print <<= 16; - print_sized_map(&print, list->width, list->height, list->letter); - if (list->same && list->dope[1]) - { - print = list->same->tetribit; - print <<= 16; - ft_putstr("same --> "); - ft_put_tetri_color(list->same->letter); - ft_putchar('\n'); - } - ft_putchar('\n'); - list = list->next; - } - } - return (size); -} - -/* -** function that print the map in binary if flag p is present -** it returns anyway the size of the map for main to print it -*/ - -int print_binary_map(unsigned int *map, int size, int *dope) -{ - size--; - if (dope[2]) - { - ft_putendl("result in binary :"); - print_sized_map(map, size, size, '#'); - ft_putchar('\n'); - } - free(map); - return (size); -} - -/* -** function that print the flags usage -*/ - -int print_flags_usage(void) -{ - ft_putendl("flags usage :"); - ft_putendl("d : debug print (print the map during the backtracking)"); - ft_putendl("o : optimisation ultra fast but with some errors still"); - ft_putendl("p : print the tetri and the map in different formats"); - ft_putendl("e : error msgs more precise AND no error for too much tetri\n"); - return (0); -} diff --git a/f_handle_errors.c b/f_handle_errors.c deleted file mode 100644 index dc27add..0000000 --- a/f_handle_errors.c +++ /dev/null @@ -1,133 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* f_handle_errors.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */ -/* Updated: 2019/05/29 15:55:03 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** Function that display error message *s on fd and exit program -*/ - -void print_error(char *str) -{ - write(1, str, ft_strlen(str)); - exit(0); -} - -/* -** Function that display error message *s on fd with more informations -*/ - -void print_error_extended(int error, int *dope) -{ - if (!dope[3]) - print_error("error\n"); - if (error == 1) - print_error("error: File contains char other than '.','#' and '\\n'\n"); - if (error == 2) - print_error("error: File contains two tetriminos not" - "separated by a '\\n'\n"); - if (error == 3) - print_error("error: File contains more than 2 '\\n' in a row\n"); - if (error == 4) - print_error("error: File contains less than 1 tetrimino " - "or more than 26\n"); - if (error == 5) - print_error("error: Tetrimino has more or less than 4 #\n"); - if (error == 6) - print_error("error: Tetrimino # are not all connected\n"); - print_error("error\n"); -} - -/* -** Function to see if there if an error if the file -** - less than 4 lines -** - more than 104 (26 tetri) + 25 (\n) = 129 lines -** - two \n in a row -*/ - -void check_file_errors(char *file, int *dope) -{ - int i; - int line_nbr; - - i = 0; - line_nbr = 0; - while (file[i]) - { - if (file[i] != '.' && file[i] != '#' && file[i] != '\n') - print_error_extended(1, dope); - else if (file[i] == '\n') - line_nbr++; - if (file[i] == '\n' && line_nbr % 5 == 0 && file[i-1] != '\n') - print_error_extended(2, dope); - if (file[i] == '\n' && file[i+1] != '\0' && \ - file[i+2] != '.' && file[i+2] != '#') - print_error_extended(3, dope); - i++; - } - if (line_nbr < 4 || line_nbr > 129) - print_error_extended(4, dope); -} - -/* -** Function that check if tetrimino square contains: -** - 4 x # -** - 12 x . -*/ - -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++; - i++; - } - if (htg != 4 || dot != 12 || check_tetri_errors_proxy(tetri)) - return (5 + check_tetri_errors_proxy(tetri)); - return (0); -} - -/* -** Function that check if 4 # (tetrimino parts) are linked -*/ - -int check_tetri_errors_proxy(char *tetri) -{ - int i; - int j; - - i = 0; - j = 0; - while (tetri[i]) - { - if (i < 19 && tetri[i] == '#' && tetri[i + 1] == '#') - j++; - if (i > 0 && tetri[i] == '#' && tetri[i - 1] == '#') - j++; - if (i < 15 && tetri[i] == '#' && tetri[i + 5] == '#') - j++; - if (i > 4 && tetri[i] == '#' && tetri[i - 5] == '#') - j++; - i++; - } - return ((j < 6) ? 1 : 0); -} diff --git a/f_parse_input.c b/f_parse_input.c deleted file mode 100644 index faaff2d..0000000 --- a/f_parse_input.c +++ /dev/null @@ -1,156 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* parse_input.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/15 14:48:14 by vmanzoni #+# #+# */ -/* Updated: 2019/06/01 14:06:07 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** function that transform a tab of . and # into a binary tab of int -*/ - -unsigned short tab_to_bin(char line[]) -{ - unsigned short tmp; - int i; - - i = 0; - tmp = 0; - while (line[i]) - { - tmp <<= 1; - if (line[i] == '\n') - i++; - if (line[i++] == '#') - tmp |= 1; - } - return (tmp); -} - -/* -** Function that take a tetrimino of 4*4 -** and reduce it to its right size, in binary -*/ - -unsigned short reduce_tetri(unsigned short tetri, int width) -{ - unsigned int mask; - unsigned int tmp; - - mask = ~0u << (32 - width) >> 16; - tmp = (mask & tetri); - tmp |= ((mask & tetri << 4) >> width); - tmp |= ((mask & tetri << 8) >> (2 * width)); - tmp |= ((mask & tetri << 12) >> (3 * width)); - return (tmp); -} - -/* -** Function that transforme a tetriminos char* into a short of 16 bites -** and then fills it and its reversed into the list -** -** 1) transforme la ligne de . et # en un short de 0 et 1 -** 2) cree un mask avec des 1 sur la colonne de droite (#...#...#...#...) -** 3) utilise le mask pour trouver la largeur que prend le tetriminos -** 4) deplace le tetriminos tout en haut a gauche -** (i - list->width = le nombre de colonne vide a gauche) -** 5) trouve la hauteur du tetri -** 6) fabrique la ligne pour le tetriminos de la bonne largeur -** -** list->test is used to debug the backtracking, allowing to print the -** map each time without the previous tries -*/ - -void fill_list(char line[], t_fillist *list) -{ - unsigned int mask; - int i; - - list->tetribit = tab_to_bin(line); - list->memory = 0; - mask = (1 << 15) | (1 << 11) | (1 << 7) | (1 << 3); - i = 0; - while (!(mask & list->tetribit) && i++ < 4) - mask >>= 1; - list->width = i; - while (mask & list->tetribit && ++i < 4) - mask >>= 1; - list->width = i - list->width; - list->tetribit <<= (i - list->width); - while (!(list->tetribit & (~0u << 12))) - list->tetribit <<= 4; - i = 0; - while (i < 4 && list->tetribit & (~0u << 28 >> (i * 4 + 16))) - i++; - list->height = i; - list->tetribit = reduce_tetri(list->tetribit, list->width); - list->same = NULL; - list->test = 0; -} - -/* -** Function that creates the linked list and add a new structure -** linked each time needed -*/ - -int add_to_list(char *line, t_fillist **lst, char letter, int *dope) -{ - t_fillist *tmp; - t_fillist *test; - - if (!(tmp = (t_fillist*)malloc(sizeof(*tmp)))) - return (0); - tmp->next = NULL; - test = *lst; - if (!test) - *lst = tmp; - else - { - while (test->next) - test = test->next; - test->next = tmp; - } - fill_list(line, tmp); - tmp->letter = letter; - tmp->dope = dope; - tmp->start = *lst; - tmp->memory = NULL; - return (1); -} - -/* -** Function that parse a file and put each tetrimino in a linked list -*/ - -int parse_input(char *input, t_fillist **list, int *dope) -{ - char tetri[20]; - int i; - int j; - int letter; - int size; - - i = 0; - letter = 'A'; - while (input[i]) - { - j = 0; - while (j < 19) - tetri[j++] = input[i++]; - tetri[19] = '\0'; - if (check_tetri_errors(tetri)) - print_error_extended(check_tetri_errors(tetri), dope); - add_to_list(tetri, list, letter++, dope); - while (input[i] && input[i] != '.' && input[i] != '#') - i++; - } - size = search_map(*list); - return (size); -} diff --git a/f_print.c b/f_print.c deleted file mode 100644 index bb0650f..0000000 --- a/f_print.c +++ /dev/null @@ -1,121 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* print.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/30 13:24:28 by hulamy #+# #+# */ -/* Updated: 2019/06/01 14:05:45 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** function that print a map of height and width -** usefull to print tetris -*/ - -void print_sized_map(unsigned int *tab, int width, int height, char letter) -{ - int i; - unsigned int mask; - - i = 0; - mask = 0; - while (i++ < width) - mask = (mask >> 1) | ((mask | 1) << 31); - i = 0; - while (i < width * height) - { - if (i && !(i % width)) - ft_putchar('\n'); - if (tab[i / 32] & (1 << (31 - i % 32))) - ft_put_tetri_color(letter); - else - ft_putchar('.'); - ft_putchar(' '); - i++; - } - write(1, "\n", 1); -} - -/* -** Print the final map with the letters -** if flag value is 0 -> print moulinette version -** if flag value is 0 -> print in color -*/ - -char *init_print_map(t_fillist *list, int size) -{ - char *map; - int i; - int j; - - map = (char *)malloc(sizeof(*map) * (size * size + 1)); - map[size * size] = '\0'; - i = -1; - while (++i < size * size) - map[i] = '.'; - while (list) - { - j = 0; - i = -1; - while (++i < list->width * list->height) - { - if (i && i % list->width == 0) - j += size - list->width; - if (1 << (15 - i) & list->tetribit && list->test == 1) - map[list->position + i + j - 1] = list->letter; - } - list = list->next; - } - return (map); -} - -/* -** Function that print the map with color if flag = 1 -** or for moulinette if flag = 0; -*/ - -void print_letter_map(t_fillist *list, int size, int flag) -{ - int i; - char *map; - - map = init_print_map(list, size); - i = -1; - while (++i < size * size) - { - if (i && i % size == 0) - ft_putchar('\n'); - if (flag == 0) - ft_putchar(map[i]); - else - { - ft_put_tetri_color(map[i]); - ft_putchar(' '); - } - } - ft_putchar('\n'); - free(map); -} - -/* -** Function that print the map -*/ - -void print_final_map(t_fillist *list, int size) -{ - if (list->dope[2]) - { - ft_putendl("result for humans :"); - print_letter_map(list, size, 1); - ft_putchar('\n'); - ft_putendl("result for moulinette :"); - } - print_letter_map(list, size, 0); - if (list->dope[2]) - ft_putchar('\n'); -} diff --git a/f_print_map_with_colors.c b/f_print_map_with_colors.c deleted file mode 100644 index 6a53edf..0000000 --- a/f_print_map_with_colors.c +++ /dev/null @@ -1,56 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* print_map_with_colors.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/05/03 20:27:22 by vmanzoni #+# #+# */ -/* Updated: 2019/05/08 09:02:39 by vmanzoni ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -void ft_putchar(char c) -{ - write(1, &c, 1); -} - -void ft_putchar_color(char c, char color) -{ - if (color == 'R') - write(1, RED, 5); - else if (color == 'B') - write(1, BLU, 5); - else if (color == 'G') - write(1, GRN, 5); - else if (color == 'Y') - write(1, YEL, 5); - else if (color == 'M') - write(1, MAG, 5); - else if (color == 'C') - write(1, CYN, 5); - else if (color == 'W' || !c) - write(1, RESET, 5); - ft_putchar(c); - write(1, RESET, 5); -} - -void ft_put_tetri_color(char c) -{ - if (c == 'A' || c == 'G' || c == 'M' || c == 'S' || c == 'Y') - ft_putchar_color(c, 'R'); - else if (c == 'B' || c == 'H' || c == 'N' || c == 'T' || c == 'Z') - ft_putchar_color(c, 'B'); - else if (c == 'C' || c == 'I' || c == 'O' || c == 'U') - ft_putchar_color(c, 'G'); - else if (c == 'D' || c == 'J' || c == 'P' || c == 'V') - ft_putchar_color(c, 'Y'); - else if (c == 'E' || c == 'K' || c == 'Q' || c == 'W') - ft_putchar_color(c, 'M'); - else if (c == 'F' || c == 'L' || c == 'R' || c == 'X') - ft_putchar_color(c, 'C'); - else - ft_putchar(c); -} diff --git a/f_read_file.c b/f_read_file.c deleted file mode 100644 index 0157491..0000000 --- a/f_read_file.c +++ /dev/null @@ -1,38 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* read_file.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/13 12:09:46 by vmanzoni #+# #+# */ -/* Updated: 2019/05/29 16:10:58 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** Function that read and return a ptr to file content -*/ - -char *read_file(char *file) -{ - char buf[BUFF_SIZE]; - int fd; - int rv; - int i; - char *result; - - if (((fd = open(file, O_RDONLY)) < 0) \ - || ((rv = read(fd, &buf, BUFF_SIZE)) < 0) \ - || !(result = malloc(sizeof(char) * rv))) - return (NULL); - buf[rv - 1] = '\0'; - i = -1; - while (buf[++i]) - result[i] = buf[i]; - result[i] = '\0'; - close(fd); - return (result); -} diff --git a/f_search_map.c b/f_search_map.c deleted file mode 100644 index e61530a..0000000 --- a/f_search_map.c +++ /dev/null @@ -1,167 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* f_search_map.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/27 20:47:22 by hulamy #+# #+# */ -/* Updated: 2019/06/01 14:04:53 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** function that look if a tretri fit in a place -*/ - -unsigned int fit_in_place(unsigned int *map, t_fillist *lst, int size, int i) -{ - unsigned int tmp; - unsigned int mask; - unsigned int tetri; - int n; - int r; - - n = lst->num; - r = lst->rank; - i = lst->height; - tetri = lst->tetribit << 16 >> lst->width; - tmp = 0; - mask = ~0u << (32 - lst->width); - while (i--) - { - if (tmp & tetri) - return (0); - if (r >= 32 && ++n) - r -= 32; - tmp = (mask & (map[n] << r)); - if (n + 1 < lst->total_num) - tmp |= (mask & (map[n + 1] >> (32 - r))); - tetri <<= lst->width; - r += size; - } - return (!(tmp & tetri)); -} - -/* -** function that look for the first place in the map for a tetri -*/ - -int find_place(unsigned int *map, t_fillist *list, int size) -{ - int limit; - int pos; - - pos = list->position; - list->place = pos % size; - list->rank = pos % 32; - list->num = pos / 32; - limit = (size - list->height + 1) * size; - while (pos < limit) - { - if (list->rank >= 32 && ++list->num) - list->rank -= 32; - if (list->place > size - list->width) - { - list->place = -1; - pos += list->width - 2; - list->rank += list->width - 2; - } - else if (fit_in_place(map, list, size, 0)) - return ((list->position = pos + 1)); - pos++; - list->place++; - list->rank++; - } - return (0); -} - -/* -** function that add or remove a tetri on the map -*/ - -void add_remove(unsigned int *map, t_fillist *list, int size) -{ - unsigned int mask; - unsigned short tetri; - int i; - int j; - - tetri = list->tetribit; - mask = ~0u << (32 - list->width); - i = (list->height - 1) * list->width; - j = (list->height - 1) * size + list->position; - while (j >= list->position) - { - map[(j - 1) / 32] ^= (mask & tetri << (16 + i)) >> (j - 1); - if ((j - 1) / 32 + 1 < list->total_num) - map[(j - 1) / 32 + 1] ^= (mask & tetri << (16 + i)) << (32 - j) << 1; - j -= size; - i -= list->width; - } -} - -/* -** Function that recursively try to fill the map with the tetris -*/ - -int fill_map(unsigned int *map, t_fillist *list, int size) -{ - if (!list) - return (1); - list->position = 0; - while (find_place(map, list, size)) - { - add_remove(map, list, size); - list->test = 1; - if (list->dope[0]) - { - print_letter_map(list->start, size, 1); - ft_putchar('\n'); - } - if (list->dope[1]) - if (check_tetri_memory(list, list->position)) - if (fill_map(map, list->next, size)) - return (1); - if (!list->dope[1]) - if (fill_map(map, list->next, size)) - return (1); - add_remove(map, list, size); - list->test = 0; - } - return (0); -} - -/* -** Function that send to "fill_map" a map of a certain size -** and increment its size untill it's solved -*/ - -int search_map(t_fillist *list) -{ - unsigned int *map; - int size; - int num; - int i; - - size = 2; - num = print_tetri(list, 0); - while (size * size < num * 4) - size++; - i = 0; - while (!i) - { - num = (size * size) / 32 + 1; - if (!(map = (unsigned int *)malloc(sizeof(*map) * num))) - return (0); - check_same_tetri(list, num); - while (num--) - map[num] = 0; - i = fill_map(map, list, size++); - if (!i) - free(map); - } - return (print_binary_map(map, size, list->dope)); -} diff --git a/fillit.dSYM/Contents/Info.plist b/fillit.dSYM/Contents/Info.plist deleted file mode 100644 index 96bfe2d..0000000 --- a/fillit.dSYM/Contents/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIdentifier - com.apple.xcode.dsym.fillit - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - dSYM - CFBundleSignature - ???? - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/fillit.h b/fillit.h deleted file mode 100644 index 387c9a4..0000000 --- a/fillit.h +++ /dev/null @@ -1,150 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* fillit.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */ -/* Updated: 2019/06/01 14:03:45 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#ifndef FILLIT_H -# define FILLIT_H - -#include -#include -#include -#include - -#include "libft/includes/libft.h" - -/* -** DEFINE -*/ - -# define BUFF_SIZE 1024 - -#define RED "\x1B[31m" -#define GRN "\x1B[32m" -#define YEL "\x1B[33m" -#define BLU "\x1B[34m" -#define MAG "\x1B[35m" -#define CYN "\x1B[36m" -#define RESET "\x1B[0m" - -/* -** Color for full block tetriminos when printing colored map -** (don't forget to comment all #define COLOR above) -*/ -//#define RED "\e[41m" -//#define GRN "\e[42m" -//#define YEL "\e[43m" -//#define BLU "\e[44m" -//#define MAG "\e[45m" -//#define CYN "\e[46m" -//#define RESET "\e[49m" - -/* -** STRUCTURE -** tetribit : tetri ecrit en binaire dans un short de 16 bits -** width : largeur du tetri -** height : hauteur du tetri -** position : memorise la position d tetri bit a bit -** place : position sur l'axe des abscisses de la map (position % size) -** rank : position de 1 a 32 dans l'int du tableau d'int (position % 32) -** num : memorise dans quel int du tableau on se trouve (position / 32) -** test : to print the tetri during the backtracking, test is a boolean -** letter : letter of the tetrimino for printing final map -** dope : flags for details, optimisation, printing and error -** memory : positions already tested by a tetrimino in bitwise -** same : pointer to previous identical tetrimino -** next : pointer to next tetrimino -** start : pointer to first tetrimino of input file -*/ -typedef struct s_fillist -{ - unsigned short tetribit; - int width; - int height; - int position; - int place; - int rank; - int num; - int total_num; - int test; - char letter; - int *dope; - unsigned int *memory; - struct s_fillist *same; - struct s_fillist *next; - struct s_fillist *start; -} t_fillist; - -/* -** bonus_print.c -*/ -int print_tetri(t_fillist *list, int size); -int print_binary_map(unsigned int *map, int size, int *dope); -int print_flags_usage(void); - -/* -** bonus_opti.c -*/ -int check_tetri_memory(t_fillist *list, int pos); -int compare_tetri(t_fillist *tetri_a, t_fillist *tetri_b); -t_fillist *clean_list_memory(t_fillist *list, t_fillist *tmp); -int check_same_tetri(t_fillist *list, int num); - -/* -** main.c -*/ -int main(int argc, char **argv); -int *create_dope(char *av, int mdp); -void clean_list(t_fillist *list, t_fillist *tmp); -int is_mdp(int ac, char **av); - -/* -** read_file.c -*/ -char *read_file(char *file); - -/* -** handle_errors.c -*/ -void print_error(char *s); -void print_error_extended(int error, int *dope); -void check_file_errors(char *file, int *dope); -int check_tetri_errors(char *tetri); -int check_tetri_errors_proxy(char *tetri); - -/* -** parse_input.c -*/ -int parse_input(char *input, t_fillist **list, int *dope); -int add_to_list(char *sqr, t_fillist **lst, char lett, int *dope); -void fill_list(char line[], t_fillist *list); -unsigned short reduce_tetri(unsigned short tetri, int width); -unsigned short tab_to_bin(char line[]); - -/* -** search_map.c -*/ -unsigned int fit_in_place(unsigned int *map, t_fillist *lst, int siz, int i); -int find_place(unsigned int *map, t_fillist *list, int size); -void add_remove(unsigned int *map, t_fillist *list, int size); -int fill_map(unsigned int *map, t_fillist *list, int size); -int search_map(t_fillist *list); - -/* -** print.c -*/ -void print_sized_map(unsigned int *tab, int width, int height, char letter); -char *init_print_map(t_fillist *list, int size); -void print_letter_map(t_fillist *list, int size, int flag); -void print_final_map(t_fillist *list, int size); - -void ft_put_tetri_color(char c); - -#endif diff --git a/main.c b/main.c deleted file mode 100644 index 539a42a..0000000 --- a/main.c +++ /dev/null @@ -1,113 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* main.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/02/12 13:20:48 by vmanzoni #+# #+# */ -/* Updated: 2019/06/01 13:58:49 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** Function that put the flags for bonus into a tab of int -** -** d : debug print (print the map during the backtracking) -** o : optimisation ultra fast but with some errors still -** p : print extended (print the tetri and the map in different formats) -** e : error extended (error message more precise AND no error for too much tetri) -*/ - -int *create_dope(char *av, int mdp) -{ - char *comp; - int *dope; - int i; - int j; - - comp = "dope"; - if (!(dope = (int*)malloc(sizeof(*dope) * 4))) - return (NULL); - i = 0; - while (i < 4) - dope[i++] = 0; - if (!mdp) - return (dope); - i = -1; - while (++i < 4 && (j = -1)) - while (av[++j]) - if (comp[i] == av[j]) - dope[i] = 1; - return (dope); -} - -/* -** Function that check if the password is good to unlock the flags -*/ - -int is_mdp(int ac, char **av) -{ - char *mdp; - int i; - - if (ac < 3 || ac > 4) - return (0); - mdp = "trompette"; - i = 0; - while (av[2][i] && mdp[i] && mdp[i] == av[2][i]) - i++; - if (av[2][i] || mdp[i]) - return (0); - if (ac == 3) - return (print_flags_usage()); - return (1); -} - -/* -** Function that free the list -*/ - -void clean_list(t_fillist *list, t_fillist *tmp) -{ - tmp = list; - while (list) - { - list = tmp->next; - free(tmp->memory); - free(tmp); - tmp = list; - } -} - -/* -** Main function -*/ - -int main(int ac, char **av) -{ - t_fillist *list; - char *input; - int *dope; - int size; - int mdp; - - list = NULL; - dope = create_dope(av[3], (mdp = is_mdp(ac, av))); - if (ac == 2 || mdp) - { - if (!(input = read_file(av[1]))) - print_error(dope[3] ? "error: Could not read file.\n" : "error\n"); - check_file_errors(input, dope); - size = parse_input(input, &list, dope); - print_final_map(list, size); - free(input); - clean_list(list, list); - } - else - print_error("usage: Please submit a file.\n> ./fillit file.fillit\n"); - free(dope); - return (0); -} diff --git a/samples/16square b/samples/16square deleted file mode 100644 index cf024ee..0000000 --- a/samples/16square +++ /dev/null @@ -1,79 +0,0 @@ -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... diff --git a/samples/1full b/samples/1full deleted file mode 100644 index f435cdf..0000000 --- a/samples/1full +++ /dev/null @@ -1,4 +0,0 @@ -#### -#### -#### -#### diff --git a/samples/1square b/samples/1square deleted file mode 100644 index 6621462..0000000 --- a/samples/1square +++ /dev/null @@ -1,4 +0,0 @@ -##.. -##.. -.... -.... diff --git a/samples/1tetri b/samples/1tetri deleted file mode 100644 index caa819e..0000000 --- a/samples/1tetri +++ /dev/null @@ -1,4 +0,0 @@ -#... -#... -#... -#... diff --git a/samples/1tetri_T b/samples/1tetri_T deleted file mode 100644 index 59b033c..0000000 --- a/samples/1tetri_T +++ /dev/null @@ -1,4 +0,0 @@ -###. -.#.. -.... -.... diff --git a/samples/1tetri_wrong b/samples/1tetri_wrong deleted file mode 100644 index d73e6f8..0000000 --- a/samples/1tetri_wrong +++ /dev/null @@ -1,4 +0,0 @@ -#... -.#.. -#... -#... diff --git a/samples/26square b/samples/26square deleted file mode 100644 index 93fb532..0000000 --- a/samples/26square +++ /dev/null @@ -1,129 +0,0 @@ -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... diff --git a/samples/26tetri b/samples/26tetri deleted file mode 100644 index 5b0667a..0000000 --- a/samples/26tetri +++ /dev/null @@ -1,129 +0,0 @@ -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# diff --git a/samples/27tetri b/samples/27tetri deleted file mode 100644 index 9dd01c6..0000000 --- a/samples/27tetri +++ /dev/null @@ -1,134 +0,0 @@ -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# diff --git a/samples/2nl b/samples/2nl deleted file mode 100644 index 77ea3e5..0000000 --- a/samples/2nl +++ /dev/null @@ -1,10 +0,0 @@ -...# -...# -...# -...# - - -...# -...# -...# -...# diff --git a/samples/2tetri b/samples/2tetri deleted file mode 100644 index 26e4931..0000000 --- a/samples/2tetri +++ /dev/null @@ -1,9 +0,0 @@ -...# -...# -...# -...# - -.... -##.. -.##. -.... diff --git a/samples/3tetri b/samples/3tetri deleted file mode 100644 index 84fea70..0000000 --- a/samples/3tetri +++ /dev/null @@ -1,14 +0,0 @@ -...# -...# -...# -...# - -.... -##.. -.##. -.... - -.... -###. -.#.. -.... diff --git a/samples/3tetribis b/samples/3tetribis deleted file mode 100644 index f08eccd..0000000 --- a/samples/3tetribis +++ /dev/null @@ -1,14 +0,0 @@ -.... -##.. -.##. -.... - -...# -...# -...# -...# - -.... -###. -..#. -.... diff --git a/samples/42 b/samples/42 deleted file mode 100644 index e40c936..0000000 --- a/samples/42 +++ /dev/null @@ -1,4 +0,0 @@ -4242 -4242 -4242 -4242 diff --git a/samples/4square b/samples/4square deleted file mode 100644 index ccf8d77..0000000 --- a/samples/4square +++ /dev/null @@ -1,19 +0,0 @@ -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... diff --git a/samples/4tetri b/samples/4tetri deleted file mode 100644 index 98a0c27..0000000 --- a/samples/4tetri +++ /dev/null @@ -1,19 +0,0 @@ -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# - -...# -...# -...# -...# diff --git a/samples/4tetribis b/samples/4tetribis deleted file mode 100644 index bac821b..0000000 --- a/samples/4tetribis +++ /dev/null @@ -1,19 +0,0 @@ -.... -##.. -.##. -.... - -...# -...# -...# -...# - -.... -###. -..#. -.... - -.... -.##. -.##. -.... diff --git a/samples/5square b/samples/5square deleted file mode 100644 index 0c77b74..0000000 --- a/samples/5square +++ /dev/null @@ -1,24 +0,0 @@ -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... diff --git a/samples/9square b/samples/9square deleted file mode 100644 index cd51566..0000000 --- a/samples/9square +++ /dev/null @@ -1,44 +0,0 @@ -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... - -##.. -##.. -.... -.... diff --git a/samples/Non_valide b/samples/Non_valide deleted file mode 100644 index 2de226b..0000000 --- a/samples/Non_valide +++ /dev/null @@ -1,19 +0,0 @@ -...# -...# -...# -...# -.... -.... -.... -#### - - -.### -...E -.... -.... - -#### -#### -#### -#### diff --git a/samples/backslash_0 b/samples/backslash_0 deleted file mode 100644 index 736267690ed29b7e508ccd127dc91e46ecf163ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20 WcmdPX)6?Tp1_CZ1g8@Y7aRC4wbONsc diff --git a/samples/bad_test b/samples/bad_test deleted file mode 100644 index 2f58fc2..0000000 --- a/samples/bad_test +++ /dev/null @@ -1,4 +0,0 @@ -.#.. -.#.. -###. -.... diff --git a/samples/debug/jdugoudr b/samples/debug/jdugoudr deleted file mode 100644 index b1d432f..0000000 --- a/samples/debug/jdugoudr +++ /dev/null @@ -1,89 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1 b/samples/debug/jdugoudr1 deleted file mode 100644 index 9af3d29..0000000 --- a/samples/debug/jdugoudr1 +++ /dev/null @@ -1,84 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr10 b/samples/debug/jdugoudr10 deleted file mode 100644 index e063174..0000000 --- a/samples/debug/jdugoudr10 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr11 b/samples/debug/jdugoudr11 deleted file mode 100644 index 42f0f07..0000000 --- a/samples/debug/jdugoudr11 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr12 b/samples/debug/jdugoudr12 deleted file mode 100644 index ebde261..0000000 --- a/samples/debug/jdugoudr12 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr13 b/samples/debug/jdugoudr13 deleted file mode 100644 index 775d744..0000000 --- a/samples/debug/jdugoudr13 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr14 b/samples/debug/jdugoudr14 deleted file mode 100644 index 86124d0..0000000 --- a/samples/debug/jdugoudr14 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr15 b/samples/debug/jdugoudr15 deleted file mode 100644 index ed90d73..0000000 --- a/samples/debug/jdugoudr15 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr16 b/samples/debug/jdugoudr16 deleted file mode 100644 index 28a2108..0000000 --- a/samples/debug/jdugoudr16 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr17 b/samples/debug/jdugoudr17 deleted file mode 100644 index aab8cde..0000000 --- a/samples/debug/jdugoudr17 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr18 b/samples/debug/jdugoudr18 deleted file mode 100644 index 36e611d..0000000 --- a/samples/debug/jdugoudr18 +++ /dev/null @@ -1,79 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# diff --git a/samples/debug/jdugoudr18_17 b/samples/debug/jdugoudr18_17 deleted file mode 100644 index 36e611d..0000000 --- a/samples/debug/jdugoudr18_17 +++ /dev/null @@ -1,79 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# diff --git a/samples/debug/jdugoudr18_17_16 b/samples/debug/jdugoudr18_17_16 deleted file mode 100644 index 8844962..0000000 --- a/samples/debug/jdugoudr18_17_16 +++ /dev/null @@ -1,74 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... diff --git a/samples/debug/jdugoudr18_17_16_15 b/samples/debug/jdugoudr18_17_16_15 deleted file mode 100644 index 0b7ea05..0000000 --- a/samples/debug/jdugoudr18_17_16_15 +++ /dev/null @@ -1,69 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... diff --git a/samples/debug/jdugoudr18_17_16_15_14 b/samples/debug/jdugoudr18_17_16_15_14 deleted file mode 100644 index 05c0611..0000000 --- a/samples/debug/jdugoudr18_17_16_15_14 +++ /dev/null @@ -1,64 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... diff --git a/samples/debug/jdugoudr18_17_16_15_14_13 b/samples/debug/jdugoudr18_17_16_15_14_13 deleted file mode 100644 index 3beb1d4..0000000 --- a/samples/debug/jdugoudr18_17_16_15_14_13 +++ /dev/null @@ -1,59 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr18_17_16_15_14_13_12 b/samples/debug/jdugoudr18_17_16_15_14_13_12 deleted file mode 100644 index 85375db..0000000 --- a/samples/debug/jdugoudr18_17_16_15_14_13_12 +++ /dev/null @@ -1,54 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... diff --git a/samples/debug/jdugoudr18_17_16_15_14_13_12_11 b/samples/debug/jdugoudr18_17_16_15_14_13_12_11 deleted file mode 100644 index c0fe84e..0000000 --- a/samples/debug/jdugoudr18_17_16_15_14_13_12_11 +++ /dev/null @@ -1,49 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# diff --git a/samples/debug/jdugoudr18_17_16_15_14_13_12_11_10 b/samples/debug/jdugoudr18_17_16_15_14_13_12_11_10 deleted file mode 100644 index 3b8fdd9..0000000 --- a/samples/debug/jdugoudr18_17_16_15_14_13_12_11_10 +++ /dev/null @@ -1,44 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_10 b/samples/debug/jdugoudr1_10 deleted file mode 100644 index 3eadd0b..0000000 --- a/samples/debug/jdugoudr1_10 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_11 b/samples/debug/jdugoudr1_11 deleted file mode 100644 index 685d545..0000000 --- a/samples/debug/jdugoudr1_11 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_12 b/samples/debug/jdugoudr1_12 deleted file mode 100644 index 0cf3681..0000000 --- a/samples/debug/jdugoudr1_12 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_13 b/samples/debug/jdugoudr1_13 deleted file mode 100644 index 4a76ca8..0000000 --- a/samples/debug/jdugoudr1_13 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_14 b/samples/debug/jdugoudr1_14 deleted file mode 100644 index 79ff446..0000000 --- a/samples/debug/jdugoudr1_14 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_15 b/samples/debug/jdugoudr1_15 deleted file mode 100644 index 6427711..0000000 --- a/samples/debug/jdugoudr1_15 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_16 b/samples/debug/jdugoudr1_16 deleted file mode 100644 index b809cb1..0000000 --- a/samples/debug/jdugoudr1_16 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_17 b/samples/debug/jdugoudr1_17 deleted file mode 100644 index cb200f9..0000000 --- a/samples/debug/jdugoudr1_17 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_18 b/samples/debug/jdugoudr1_18 deleted file mode 100644 index 22de5f5..0000000 --- a/samples/debug/jdugoudr1_18 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... diff --git a/samples/debug/jdugoudr1_2 b/samples/debug/jdugoudr1_2 deleted file mode 100644 index b213006..0000000 --- a/samples/debug/jdugoudr1_2 +++ /dev/null @@ -1,79 +0,0 @@ -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3 b/samples/debug/jdugoudr1_2_3 deleted file mode 100644 index 5680555..0000000 --- a/samples/debug/jdugoudr1_2_3 +++ /dev/null @@ -1,74 +0,0 @@ -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4 b/samples/debug/jdugoudr1_2_3_4 deleted file mode 100644 index 5780f70..0000000 --- a/samples/debug/jdugoudr1_2_3_4 +++ /dev/null @@ -1,69 +0,0 @@ -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4_5 b/samples/debug/jdugoudr1_2_3_4_5 deleted file mode 100644 index 3f51da5..0000000 --- a/samples/debug/jdugoudr1_2_3_4_5 +++ /dev/null @@ -1,64 +0,0 @@ -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4_5_6 b/samples/debug/jdugoudr1_2_3_4_5_6 deleted file mode 100644 index 6bff131..0000000 --- a/samples/debug/jdugoudr1_2_3_4_5_6 +++ /dev/null @@ -1,59 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4_5_6_7 b/samples/debug/jdugoudr1_2_3_4_5_6_7 deleted file mode 100644 index dda7d14..0000000 --- a/samples/debug/jdugoudr1_2_3_4_5_6_7 +++ /dev/null @@ -1,54 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4_5_6_7_8 b/samples/debug/jdugoudr1_2_3_4_5_6_7_8 deleted file mode 100644 index c68ec94..0000000 --- a/samples/debug/jdugoudr1_2_3_4_5_6_7_8 +++ /dev/null @@ -1,49 +0,0 @@ -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4_5_6_7_8_9 b/samples/debug/jdugoudr1_2_3_4_5_6_7_8_9 deleted file mode 100644 index 3b8fdd9..0000000 --- a/samples/debug/jdugoudr1_2_3_4_5_6_7_8_9 +++ /dev/null @@ -1,44 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10 b/samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10 deleted file mode 100644 index 6deecf3..0000000 --- a/samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10 +++ /dev/null @@ -1,39 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_3 b/samples/debug/jdugoudr1_3 deleted file mode 100644 index 68560bc..0000000 --- a/samples/debug/jdugoudr1_3 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_4 b/samples/debug/jdugoudr1_4 deleted file mode 100644 index 3ad9279..0000000 --- a/samples/debug/jdugoudr1_4 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_5 b/samples/debug/jdugoudr1_5 deleted file mode 100644 index 1a5d651..0000000 --- a/samples/debug/jdugoudr1_5 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_6 b/samples/debug/jdugoudr1_6 deleted file mode 100644 index fdf8daa..0000000 --- a/samples/debug/jdugoudr1_6 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_7 b/samples/debug/jdugoudr1_7 deleted file mode 100644 index 9ea86ad..0000000 --- a/samples/debug/jdugoudr1_7 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_8 b/samples/debug/jdugoudr1_8 deleted file mode 100644 index 4f5e3d6..0000000 --- a/samples/debug/jdugoudr1_8 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr1_9 b/samples/debug/jdugoudr1_9 deleted file mode 100644 index 94d3cdd..0000000 --- a/samples/debug/jdugoudr1_9 +++ /dev/null @@ -1,79 +0,0 @@ -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr2 b/samples/debug/jdugoudr2 deleted file mode 100644 index b402092..0000000 --- a/samples/debug/jdugoudr2 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr3 b/samples/debug/jdugoudr3 deleted file mode 100644 index 01c893b..0000000 --- a/samples/debug/jdugoudr3 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr4 b/samples/debug/jdugoudr4 deleted file mode 100644 index 2213760..0000000 --- a/samples/debug/jdugoudr4 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr5 b/samples/debug/jdugoudr5 deleted file mode 100644 index aa32df5..0000000 --- a/samples/debug/jdugoudr5 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr6 b/samples/debug/jdugoudr6 deleted file mode 100644 index 1f8e59d..0000000 --- a/samples/debug/jdugoudr6 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr7 b/samples/debug/jdugoudr7 deleted file mode 100644 index 742d649..0000000 --- a/samples/debug/jdugoudr7 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr8 b/samples/debug/jdugoudr8 deleted file mode 100644 index 8345bac..0000000 --- a/samples/debug/jdugoudr8 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -.... -###. -#... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/debug/jdugoudr9 b/samples/debug/jdugoudr9 deleted file mode 100644 index 118a6cf..0000000 --- a/samples/debug/jdugoudr9 +++ /dev/null @@ -1,84 +0,0 @@ -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... - -#### -.... -.... -.... - -.##. -##.. -.... -.... - -##.. -.##. -.... -.... - -...# -...# -...# -...# - -#... -##.. -.#.. -.... - -.... -###. -#... -.... diff --git a/samples/difficile b/samples/difficile deleted file mode 100644 index e9e0c68..0000000 --- a/samples/difficile +++ /dev/null @@ -1,114 +0,0 @@ -.... -.... -..## -.##. - -.... -.##. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -###. -.#.. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.### -..#. -.... - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -..#. -..#. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -..#. -..#. -..## - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -#### -.... diff --git a/samples/difficile_ou_pas b/samples/difficile_ou_pas deleted file mode 100644 index d0c08a8..0000000 --- a/samples/difficile_ou_pas +++ /dev/null @@ -1,114 +0,0 @@ -.... -.... -..## -.##. - -.... -.##. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -###. -.#.. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.### -..#. -.... - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -..#. -..#. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -..#. -..#. -..## - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -#### -....i diff --git a/samples/empty b/samples/empty deleted file mode 100644 index e69de29..0000000 diff --git a/samples/error1 b/samples/error1 deleted file mode 100644 index bab3638..0000000 --- a/samples/error1 +++ /dev/null @@ -1,8 +0,0 @@ -#### -.... -.... -.... -#### -.... -.... -.... diff --git a/samples/error2 b/samples/error2 deleted file mode 100644 index 86ee25b..0000000 --- a/samples/error2 +++ /dev/null @@ -1,9 +0,0 @@ -.#.. -.##. -..#. -.... - -.#.. -.#.. -..#. -..#. diff --git a/samples/full b/samples/full deleted file mode 100644 index c6a2a04..0000000 --- a/samples/full +++ /dev/null @@ -1,19 +0,0 @@ -###. -#... -.... -.... - -.... -.... -#... -###. - -.... -.##. -.##. -.... - -...# -...# -...# -...# diff --git a/samples/invalid_sample b/samples/invalid_sample deleted file mode 100644 index 9748b4a..0000000 --- a/samples/invalid_sample +++ /dev/null @@ -1,20 +0,0 @@ -...# -...# -...# -...# -.... -.... -.... -#### - - -.### -...# -.... -.... - -.... -..## -.##. -.... - diff --git a/samples/map_hard b/samples/map_hard deleted file mode 100644 index 887429b..0000000 --- a/samples/map_hard +++ /dev/null @@ -1,49 +0,0 @@ -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... diff --git a/samples/map_slack b/samples/map_slack deleted file mode 100644 index 6f6a1e5..0000000 --- a/samples/map_slack +++ /dev/null @@ -1,99 +0,0 @@ -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... diff --git a/samples/newline b/samples/newline deleted file mode 100644 index 8b13789..0000000 --- a/samples/newline +++ /dev/null @@ -1 +0,0 @@ - diff --git a/samples/opti_test b/samples/opti_test deleted file mode 100644 index 1f3c081..0000000 --- a/samples/opti_test +++ /dev/null @@ -1,14 +0,0 @@ -...# -.### -.... -.... - -.... -#... -##.. -.#.. - -##.. -.##. -.... -.... diff --git a/samples/sujet_1 b/samples/sujet_1 deleted file mode 100644 index 2430a47..0000000 --- a/samples/sujet_1 +++ /dev/null @@ -1,19 +0,0 @@ -.... -##.. -.#.. -.#.. - -.... -#### -.... -.... - -#... -###. -.... -.... - -.... -##.. -.##. -.... diff --git a/samples/sujet_2 b/samples/sujet_2 deleted file mode 100644 index a2f91ba..0000000 --- a/samples/sujet_2 +++ /dev/null @@ -1,39 +0,0 @@ -...# -...# -...# -...# - -.... -.... -.... -#### - -.### -...# -.... -.... - -.... -..## -.##. -.... - -.... -.##. -.##. -.... - -.... -.... -##.. -.##. - -##.. -.#.. -.#.. -.... - -.... -###. -.#.. -.... diff --git a/samples/test b/samples/test deleted file mode 100644 index cb1a109..0000000 --- a/samples/test +++ /dev/null @@ -1,4 +0,0 @@ -..#. -..#. -..#. -.. diff --git a/samples/test7 b/samples/test7 deleted file mode 100644 index 0c717b2..0000000 --- a/samples/test7 +++ /dev/null @@ -1,34 +0,0 @@ -...# -...# -...# -...# - -.... -.... -.... -#### - -.### -...# -.... -.... - -.... -..## -.##. -.... - -.... -.##. -.##. -.... - -.... -.... -##.. -.##. - -##.. -.#.. -.#.. -.... diff --git a/samples/test_11 b/samples/test_11 deleted file mode 100644 index 00aaef8..0000000 --- a/samples/test_11 +++ /dev/null @@ -1,54 +0,0 @@ -.... -.... -..## -.##. - -.... -.##. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -###. -.#.. - -.... -.... -..## -.##. - -.... -.... -..## -.##. diff --git a/samples/test_8 b/samples/test_8 deleted file mode 100644 index 5b63f79..0000000 --- a/samples/test_8 +++ /dev/null @@ -1,39 +0,0 @@ -.... -.... -..## -.##. - -.... -.##. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. diff --git a/samples/test_a b/samples/test_a deleted file mode 100644 index 21d1aac..0000000 --- a/samples/test_a +++ /dev/null @@ -1,19 +0,0 @@ -.... -.... -#... -###. - -..#. -..#. -.##. -.... - -.#.. -.#.. -.#.. -.#.. - -##.. -##.. -.... -.... diff --git a/samples/test_bug b/samples/test_bug deleted file mode 100644 index 0e8a3bd..0000000 --- a/samples/test_bug +++ /dev/null @@ -1,4 +0,0 @@ -#... -###. -.... -.... diff --git a/samples/test_opti b/samples/test_opti deleted file mode 100644 index 1808a8c..0000000 --- a/samples/test_opti +++ /dev/null @@ -1,19 +0,0 @@ -..#. -..#. -..## -.... - -.... -.##. -.##. -.... - -..#. -..#. -..## -.... - -..#. -..#. -..## -.... diff --git a/samples/test_ultra_lent b/samples/test_ultra_lent deleted file mode 100644 index 6f6a1e5..0000000 --- a/samples/test_ultra_lent +++ /dev/null @@ -1,99 +0,0 @@ -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... - -...# -...# -..## -.... - -#... -###. -.... -.... - -.#.. -.#.. -##.. -.... - -...# -...# -..## -.... diff --git a/samples/tetri_wrong b/samples/tetri_wrong deleted file mode 100644 index 2d8e6c0..0000000 --- a/samples/tetri_wrong +++ /dev/null @@ -1,124 +0,0 @@ -.... -.... -..## -.##. - -.... -.##. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -###. -.#.. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.### -..#. -.... - -#... -.#.. -#... -#... - -.... -.... -..## -.##. - -.... -.##. -..#. -..#. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -..## -.##. - -.... -.... -###. -.#.. - -.... -.... -..## -.##. diff --git a/samples/two b/samples/two deleted file mode 100644 index 3f1734a..0000000 --- a/samples/two +++ /dev/null @@ -1,4 +0,0 @@ -...# -...# -...# -...# diff --git a/samples/valid_sample b/samples/valid_sample deleted file mode 100644 index 8c28d9d..0000000 --- a/samples/valid_sample +++ /dev/null @@ -1,19 +0,0 @@ -...# -...# -...# -...# - -.... -.... -.... -#### - -.### -...# -.... -.... - -.... -..## -.##. -.... diff --git a/samples/valid_sample_with_newline b/samples/valid_sample_with_newline deleted file mode 100644 index cf7ea58..0000000 --- a/samples/valid_sample_with_newline +++ /dev/null @@ -1,20 +0,0 @@ -...# -...# -...# -...# - -.... -.... -.... -#### - -.### -...# -.... -.... - -.... -..## -.##. -.... - diff --git a/test_files/test_add_to_list.c b/test_files/test_add_to_list.c deleted file mode 100644 index ab16e12..0000000 --- a/test_files/test_add_to_list.c +++ /dev/null @@ -1,95 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* add_to_list.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/14 15:20:53 by hulamy #+# #+# */ -/* Updated: 2019/04/30 14:14:32 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" -//#include - -/* -** DELETE BEFORE EVAL - TEST FUNCTION -** Function that prints a 16 bites short -*/ -/* -void print_bits(short line) -{ - int mask; - - mask = 1 << 16; - while (mask >>= 1) - (line & mask) ? write(1, "1", 1) : write(1, "0", 1); - write(1, "\n", 1); -} -*/ - -/* -** Function that transforme a tetrminos char* into a short of 16 bites -** and then fills it and its reversed into the list -*/ - -void fill_list(char line[], t_fillist *list) -{ - int i; - - i = 0; - while (line[i]) - { - list->tetribit <<= 1; - if (line[i] == '\n') - i++; - if (line[i++] == '#') - list->tetribit |= 1; - print_bits(list->tetribit, 16); - } -// print_bits(list->tetribit); -} - -/* -** Function that create the linked list and add a new structure -** linked each time needed -*/ - -int add_to_list(char *line, t_fillist **list) -{ - t_fillist *tmp; - - if (!(tmp = (t_fillist*)malloc(sizeof(*tmp)))) - return (0); - if (!(*list)) - tmp->next = NULL; - else - tmp->next = *list; - *list = tmp; - fill_list(line, *list); - return (1); -} - -/* -** DELETE BEFORE EVAL - MAIN FOR TEST -*/ - -//int main(int ac, char **av) -//{ -// static t_fillist *list = NULL; // avant d'appeller add_to_list il faut declarer un pointeur static vers la structure -// int i; -// -// if (ac > 1) -// { -// add_to_list(*(++av), &list); -// while (list && (i = -1)) -// { -// printf("%d\n", list->tetribit); -// print_bits(list->tetribit); -// print_bits(list->tibirtet); -// list = list->next; -// } -// } -// return (0); -//} diff --git a/test_files/test_big_map.c b/test_files/test_big_map.c deleted file mode 100644 index 7e09536..0000000 --- a/test_files/test_big_map.c +++ /dev/null @@ -1,105 +0,0 @@ -#include - -void print_bits(int octet) -{ - unsigned int i; - - i = 1 << 31; - while (i) - { - (octet & i) ? printf("1") : printf("0"); - i >>= 1; - } -} - -void print_short(short octet) -{ - unsigned int i; - - i = 1 << 15; - while (i) - { - (octet & i) ? printf("1") : printf("0"); - i >>= 1; - } -} - -/* -** cette fonction affiche un mask qui se decale le long d'un tableau d'int -** lancer avec gcc test_big_map.c puis ./a.out pour voir -*/ - -void test(unsigned int map[]) -{ - int i; - int j; - int k; - int l; - unsigned int mask; - short tetri; - - tetri = (1 << 4) | (1 << 5) | (1 << 6); - mask = map[9]; - i = -1; - j = 9; - while (j >= 0) - { - // a chaque fois que mask s'est decale jusqu'au int precedant du tableau, le if suivant reaffiche le tableau en une ligne - if (!(++i % 32) && j-- && (k = -1)) - { - while (++k < 10) - print_bits(map[k]); - printf("\n"); - } - // imprime le bon nombre d'espaces pour que le mask s'imprime pile sous le tableau d'int a la position ou il en est - l = 0; - while (l++ < 320 - 32 - i) - printf(" "); - // imprime le mask - print_bits(mask); - printf("\n"); - // compare le mask (int) avec le short et l'imprime s'ils sont compatibles - if (!(tetri & mask)) - { - l = 0; - printf(">>>>>"); - while (l++ < 320 - 32 + 16 - i - 5) - printf(" "); - print_short(tetri); - printf("\n"); - } -/* - else - { - l = 0; - while (l++ < 320 - 32 + 16 - i) - printf(" "); - print_short(tetri); - printf("\n"); - } - l = 0; - while (l++ < 320 - 32 + 16 - i) - printf(" "); - print_short(tetri & mask); - printf("\n"); -*/ - // fait tourner le mask le long du tableau d'int - // (mask >> 1) decale le mask vers la droite (perd le bit le plus a droite et insere un bit a gauche) - // (1 << (i % 32)) creer un mask avec un 1 a la premiere place a droite, puis a la deuxieme, puis la troisieme, etc.. jusqu'a 32, et recommence - // (0000000000000010000000 & map[j]) recupere la valeur du bit de map[j] (qui est la map precedante sur le tableau d'int) a la position du 1 - // (0000000000000010000000 << (31 - (i % 32))) = 100000000000000000000 - // (mask >> 1) | 1000000000000000000000 = insere le 32eme bit dans mask - mask = (mask >> 1) | (((1 << (i % 32)) & map[j]) << (31 - (i % 32))); - } -} - -int main() -{ - unsigned int map[10] = {1568713153, 817645681, 654186132, 538171355, 1718453135, 551286515, 1631843343, 3413834313, 1155555555, 999999999}; - int i; - - //while (i < 10) - // printf("%d\n", map[i++]); - test(map); - return (0); -} diff --git a/test_files/test_big_tetri.c b/test_files/test_big_tetri.c deleted file mode 100644 index e2b5198..0000000 --- a/test_files/test_big_tetri.c +++ /dev/null @@ -1,125 +0,0 @@ -#include "./libft/includes/libft.h" - -void print_bits(unsigned int bits, int size) -{ - unsigned int mask; - - mask = 1 << (size - 1); - while (mask) - { - (bits & mask) ? write(1, "#", 1) : write(1, ".", 1); - write(1, " ", 1); - mask >>= 1; - } - write(1, "\n", 1); -} - -void print_map(unsigned int *tab, int width, int height) -{ - int i; - unsigned int mask; - - i = 0; - // creer un mask avec les size bits de gauche a 1 (ex: 11111110000000000000000000000000) - mask = ~0u << (32 - width); - while (i < width * height) - { - if (!(i % width)) - ft_putchar('\n'); - tab[i / 32] & (1 << (31 - i % 32)) ? ft_putchar('#') : ft_putchar('.'); - ft_putchar(' '); - i++; - } - write(1, "\n", 1); -} - -void find_place(unsigned int *tab, char *line, int size) -{ - unsigned short tetri; - int i; - int j; - unsigned int mask; - unsigned int tmp; - int width; - int height; - - /////////////// create tetri /////////////// - i = 0; - tmp = 0; - width = 3; - height = 2; - while (line[i]) - { - tetri <<= 1; - if (line[i] == '\n') - i++; - if (line[i++] == '#') - tetri |= 1; - } - while (!(tetri & (1 << 15))) - tetri <<= 1; - print_bits(tetri, 16); - tmp = (tetri | tmp) << 16; - print_map(&tmp, width, height); - /////////////// create tetri /////////////// - - mask = ~0; - mask <<= 32 - width; - ft_putendl("mask: "); - print_bits(mask, 32); - i = 0; - while (i < (size - height + 1) * size) - { - tmp = 0; - j = height * size + i; - while (j >= i) - { - tmp >>= width; - tmp |= (mask & (tab[j / 32] << j)); - tmp |= (mask & (tab[(j + size) / 32] >> (32 - j))); - j -= size; - } - print_map(&tmp, width, height); - print_bits(tmp >> 16, 32); - print_bits(tetri, 32); - print_bits((tmp >> 16) & tetri, 32); - if (i % size == size - width) - i += width - 1; - i++; - } -} - -int main(int ac, char **av) -{ - unsigned int tab[8]; - - // ce tableau permet de monter jusqu'a une map de 16*16 - tab[0] = 2656554334; - tab[1] = 1394456818; - tab[2] = 1494256918; - tab[3] = 2656554334; - tab[4] = 1592453883; - tab[5] = 1444352908; - tab[6] = 2154339230; - tab[7] = 1576493154; - print_bits(tab[0], 32); - print_bits(tab[1], 32); - print_bits(tab[2], 32); - print_bits(tab[3], 32); - print_bits(tab[4], 32); - print_bits(tab[5], 32); - print_bits(tab[6], 32); - print_bits(tab[7], 32); - if (ac > 1) - { - ++av; - // mettre l'option "b" pour afficher la troisieme argument en binaire - if (av[0][0] == 'b' && ac > 2) - ft_putendl(ft_convertbase(av[1], "01", "0123456789")); - print_map(tab, 10, 10); - write(1, "\n", 1); - if (av[0][0] == 't' && ac > 2) - find_place(tab, av[1], 10); - } - return (0); -} diff --git a/test_files/test_get_smallest_square.c b/test_files/test_get_smallest_square.c deleted file mode 100644 index 386d4f9..0000000 --- a/test_files/test_get_smallest_square.c +++ /dev/null @@ -1,35 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* get_smallest_square.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/12 22:29:45 by vmanzoni #+# #+# */ -/* Updated: 2019/04/27 15:04:46 by vmanzoni ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** Function to bruteforce with backtracking for smallest square -*/ - -int *get_smallest_square(t_fillist list, int size, unsigned int map[]) -{ - unsigned int mask; - int i; - int j; - - i = 0; - mask = map[size]; - while (list.tetribit != NULL) - { - mask = (mask >> 1) | (((1 << (i % 32)) & map[j]) << (31 - (i % 32))); - if (!(tetri & mask)) - return (1); - i++; - } - return (0); -} diff --git a/test_files/test_mask.c b/test_files/test_mask.c deleted file mode 100644 index 940fc6f..0000000 --- a/test_files/test_mask.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "libft.h" - -void print_bits(int octet) -{ - int i; - int j; - - i = 1 << 12; -// i = 4096; - while (i >>= 1) - (octet & i) ? ft_putnbr(1) : ft_putnbr(0); - ft_putchar('\n'); -} - -void compare(int initial, int compare) -{ - compare ^= (1 << 3); - print_bits(compare); - ft_putchar('\n'); - - /* - // il faut utiliser le & car il transforme - // 0+0=0 1+0=0 0+1=0 mais 1+1=1 - // donc si rien ne se superpose on obtient 0 - // et si un seul bit se superpose on obtient 1 - // (penser a l'utiliser a l'envers donc) - */ - - while (initial & compare) - { - print_bits(initial); - print_bits(compare); - print_bits(initial & compare); - !(initial & compare) ? ft_putendl("&: fit") : ft_putendl("&: not fit"); - compare >>= 1; - } - print_bits(initial); - print_bits(compare); - print_bits(initial & compare); - !(initial & compare) ? ft_putendl("&: fit") : ft_putendl("&: not fit"); - -/* - j = 1 << 12; - while (j >>= 1) - (initial | compare) & j ? ft_putnbr(1) : ft_putnbr(0); - ft_putchar('\n'); - (initial | compare) ? ft_putendl("|: fit") : ft_putendl("|: not fit"); - j = 1 << 12; - while (j >>= 1) - (initial ^ compare) & j ? ft_putnbr(1) : ft_putnbr(0); - ft_putchar('\n'); - (initial ^ compare) ? ft_putendl("^: fit") : ft_putendl("^: not fit"); -*/ -} - -int main(int ac, char **av) -{ - int i; - int j; - -// i = 56173; -// j = 9362; - i = 9622; - j = 27; - if (ac > 0) - { - if (ac > 1) - ft_putendl(ft_convertbase(av[1], "0123456789", "01")); - print_bits(i); - print_bits(j); - compare(i, j); - } - return (0); -} - -/* -int main(int ac, char **av) -{ - int init; - int mask; - - mask = (1 << 4); - if (ac == 4) - { - ft_putendl(ft_convertbase(av[1], av[2], av[3])); - ft_putnbrendl(init); - init |= mask; - ft_putnbrendl(init); - } - return (0); -} -*/ diff --git a/test_files/test_othermethod_fillit.c b/test_files/test_othermethod_fillit.c deleted file mode 100644 index 22cc411..0000000 --- a/test_files/test_othermethod_fillit.c +++ /dev/null @@ -1,266 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* test_othermethod_fillit.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/05/01 15:25:46 by vmanzoni #+# #+# */ -/* Updated: 2019/05/02 17:08:26 by vmanzoni ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft/includes/libft.h" -#include - -typedef struct s_fillist -{ - unsigned int tetribit; - int position; - struct s_fillist *next; -} t_fillist; - -/* ***************************************************************************** -** TEST FUNCTION -***************************************************************************** */ - -void print_bits(char *str, unsigned int bits, int size) -{ - unsigned int mask; - - ft_putstr(str); - mask = 1 << (size - 1); - while (mask) - { - (bits & mask) ? write(1, "1", 1) : write(1, "0", 1); - mask >>= 1; - } - write(1, "\n", 1); -} - -void print_tetri(unsigned int bits, int size) -{ - unsigned int mask; - short i; - - i = 0; - mask = 1 << (size - 1); - while (mask) - { - if (i % 4 == 0) - write(1, "\n", 1); - (bits & mask) ? write(1, "#", 1) : write(1, ".", 1); - mask >>= 1; - i++; - } - write(1, "\n", 1); -} - -/* ***************************************************************************** -** PROGRAM -***************************************************************************** */ - -void error(char *str) -{ - ft_putstr(str); - exit(0); -} - -char *read_file(char *file) -{ - char buf[1000]; - int fd; - int rv; - int i; - char *result; - - if (((fd = open(file, O_RDONLY)) < 0) \ - || ((rv = read(fd, &buf, 130)) < 0) \ - || !(result = malloc(sizeof(char) * rv))) - return (NULL); - buf[rv] = '\0'; - i = -1; - while (buf[++i]) - result[i] = buf[i]; - close(fd); - return (result); -} - -unsigned int tetribit_resize(unsigned int tetribit, - unsigned int from_size, - unsigned int to_size) -{ - unsigned int mask; - unsigned int i; - unsigned int j; - unsigned int ret; - unsigned int new_tet; - - i = from_size; - mask = 0; - while (i--) - mask |= (1 << i) + 1; //Cree un mask de from_size en bit -// print_bits("tet: ", tetribit, 32); -// print_bits("mak: ", mask, 32); - new_tet = tetribit & mask; //initialise new_tet avec la ligne du bas de tetribit -// print_bits("new: ", new_tet, 32); -// ft_putstr("while\n"); - j = 0; - while (j < from_size - 1) //pour chaque ligne du tetribit - { - i = 0; - mask = 0; - while (i != from_size) //on fait un mask sur chaque ligne - mask |= 1 << (from_size + (from_size * j) + i++); -// print_bits("tet: ", tetribit, 32); -// print_bits("mak: ", mask, 32); - ret = (tetribit & mask); -// print_bits("rbf: ",ret, 32); - ret = ret << (to_size - from_size + (j * (to_size - from_size))); -// print_bits("raf: ",ret, 32); - new_tet |= ret; -// print_bits("new: ",new_tet, 32); - j++; - } - return (new_tet); -} - -unsigned int tetri_to_binary(char line[]) -{ - unsigned int tmp; - int i; -// unsigned int mask; - - i = 0; - tmp = 0; - while (line[i]) - { - tmp <<= 1; - if (line[i] == '\n') - i++; - if (line[i++] == '#') - tmp |= 1; - } -// mask = (1 << 3 | 1 << 2 | 1 << 1) + 1; -// while ((tmp & mask) < 8) //place le tetri le plus en bas a droite possible sans le casser -// tmp /= 2; -// print_bits("before\n", tmp, 32); -// print_bits("after\n", tetribit_resize(tmp, 4, 5), 32); - return (tmp); -} - -int add_to_list(char *line, t_fillist **list) -{ - t_fillist *tmp; - t_fillist *test; - - if (!(tmp = (t_fillist*)malloc(sizeof(*tmp)))) - return (0); - tmp->next = NULL; - test = *list; - if (!test) - *list = tmp; - else - { - while(test->next) - test = test->next; - test->next = tmp; - } - tmp->tetribit = tetri_to_binary(line); - return (1); -} - -unsigned int *init_map(int i) -{ - unsigned int *new; - int size; - - size = (i * i) / 32 + 1; - new = (unsigned int *)malloc(sizeof(*new) * size); - while (size) - new[size--] = 0; - return (new); -} - -int find_place(unsigned int *map, t_fillist *list) -{ - ft_putstr(">>>\n"); - print_bits("map: ", *map, 32); - print_bits("lst: ", list->tetribit, 32); - print_bits("m&l: ", (*map & (short)(list->tetribit)), 32); - while ((*map & (int)(list->tetribit)) == 0 - && ((int)(list->tetribit) & (1 << 31))) - { - list->tetribit = list->tetribit << 1; - print_bits("lst: ", list->tetribit, 32); - ft_putnbr(list->tetribit); - } - return (0); -} - -int backtracking(t_fillist *list) -{ - unsigned int *map; - - map = init_map(1); - if (!list) - return (0); -// while (list) -// { -// print_bits("test: ", list->tetribit, 16); -// list = list->next; -// } - find_place(map, list); -// list = list->next; -// find_place(map, list); - /* - while (find_place(map, list)) - { - add_remove(map, list, size, list->position); - if (fill_map(map, list->next)) - return (1); - add_remove(map, list, size, list->position); - list->position++; - } - */ - return (0); -// mask = (mask >> 1) | (((1 << (i % 32)) & map[j]) << (31 - (i % 32))); -} - -void parse_file(char *file, t_fillist *list) -{ - char tetri[20]; - int i; - int j; - - i = 0; - while (file[i]) - { - if (file[i] != '.' && file[i] != '#' && file[i] != '\n') - error("error.\n"); - j = 0; - while (j < 19) - tetri[j++] = file[i++]; - tetri[19] = '\0'; - add_to_list(tetri, &list); - while (file[i] && file[i] != '.' && file[i] != '#') - i++; - } - backtracking(list); -} - -int solve(char *file) -{ - static t_fillist *list = NULL; - - parse_file(read_file(file), list); - return (1); -} - -int main(int ac, char **av) -{ - if (ac == 2) - solve(av[1]); - else - error("usage: ./fillit [file]\n"); -} diff --git a/test_files/test_print_fillit.c b/test_files/test_print_fillit.c deleted file mode 100644 index cf906a5..0000000 --- a/test_files/test_print_fillit.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* print_fillit.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: vmanzoni +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/03/01 13:35:48 by vmanzoni #+# #+# */ -/* Updated: 2019/04/16 16:41:46 by vmanzoni ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -void ft_print_fillit() -{ - -} -*/ diff --git a/test_files/test_search_map2.c b/test_files/test_search_map2.c deleted file mode 100644 index 65f21c8..0000000 --- a/test_files/test_search_map2.c +++ /dev/null @@ -1,382 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* search_map.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2019/04/27 20:47:22 by hulamy #+# #+# */ -/* Updated: 2019/05/24 14:41:08 by hulamy ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "fillit.h" - -/* -** OLD VERSION of find_place and fit_in_place all in one but with a lot of divisions and modulo -** -** int find_place(unsigned int *tab, t_fillist *list, int size, int pos) -** { -** int i; -** int j; -** unsigned int mask; -** unsigned int tmp; -** -** mask = ~0u << (32 - list->width); -** tmp = mask; -** i = pos; -** while (i < (size - list->height + 1) * size) -** { -** if (i % size == size - list->width + 1) -** i += list->width - 1; -** else -** { -** tmp = 0; -** j = (list->height - 1) * size + i; -** while (j >= i) -** { -** tmp >>= list->width; -** tmp |= (mask & (tab[j / 32] << j)); -** tmp |= (mask & (tab[(j + list->width) / 32] >> (32 - j))); -** j -= size; -** } -** if (!((tmp >> 16) & list->tetribit)) -** return (i + 1); -** i++; -** } -** } -** return (0); -** } -*/ - -/* -** function that try to optimize the speed -** SECOND ATTEMPT -** by finding the isolated dots whille fillling the map -** untill they get more numerous than the max amount available -** TOTAL FAILURE :p -** -** int check_others(unsigned int *map, t_fillist *list, int size, int num) -** { -** t_fillist *tmp; -** int dots; -** int total; -** int i; -** int j; -** -** dots = 0; -** i = -1; -** num *= 4; -** total = size * size; -** while (++i < total && dots <= total - num) -** { -** tmp = list->next; -** j = 1; -** // saute les position pas vides -** while (1 << (i % 32) & map[i % 32]) -** i++; -** // pour chaque position vide regarde si chaque tetri non encode places peuvent y rentrer -** while (j && tmp) -** { -** // si le tetri est trop a droite ou trop en bas il ne rentre pas ce n'est pas la peine de chercher donc on passe au tetri suivant -** if (tmp->width > (size - i % size) || (total - i) <= (tmp->height * size)) -** tmp = tmp->next; -** // sinon verifier si on peut le mettre a cette position et si on ne peut pas passer au tetri suivant -** else if (!fit_in_place(map, list, size, i)) -** tmp = tmp->next; -** // si le tetri peut rentrer on arrete la boucle en mettant j = 0 -** else -** j = 0; -** } -** // si j existe c que le tetri ne pouvait pas etre place donc on rajoute 1 au compteur de point isoles -** if (j) -** dots++; -** } -** return (dots > total - num); -** } -*/ - -/* -** function that try to optimize the speed -** FIRST ATTEMPT -** by verifying if the place left is enough to place at least -** one of each tetri left -** TOTAL FAILURE :p -** -** int check_others(unsigned int *map, t_fillist *list, int size, int num) -** { -** t_fillist *tmp; -** -** // verifie que les tetri restant puissent un par un se placer sur la map -** // ca n'optimise qu'en fin de map donc ca ralentit les grosses map en fait -** while ((tmp = tmp->next)) -** if (!find_place(map, tmp, size, 0)) -** return (0); -** return (1); -** } -*/ - -/* -** function that look if a tretri fit in a place -*/ - -unsigned int fit_in_place(unsigned int *map, t_fillist *lst, int size, int i) -{ - unsigned int tmp; - unsigned int mask; - unsigned int tetri; - int n; - int r; - - n = lst->num; - r = lst->rank; - i = lst->height; - tetri = lst->tetribit << 16 >> lst->width; - tmp = 0; - mask = ~0u << (32 - lst->width); - while (i--) - { - if (tmp & tetri) - return (0); - if (r >= 32 && ++n) - r -= 32; - tmp = (mask & (map[n] << r)) | (mask & (map[n + 1] >> (32 - r))); - tetri <<= lst->width; - r += size; - } - return (!(tmp & tetri)); -} - -/* -** function that look for the first place in the map for a tetri -*/ - -int find_place(unsigned int *map, t_fillist *list, int size) -{ - int limit; - int pos; - - pos = list->position; - list->place = pos % size; - list->rank = pos % 32; - list->num = pos / 32; - limit = (size - list->height + 1) * size; - while (pos < limit) - { - if (list->rank >= 32 && ++list->num) - list->rank -= 32; - if (list->place > size - list->width) - { - list->place = -1; - pos += list->width - 2; - list->rank += list->width - 2; - } - else if (fit_in_place(map, list, size, 0)) - return ((list->position = pos + 1)); - pos++; - list->place++; - list->rank++; - } - return (0); -} - -/* -** function that add or remove a tetri on the map -*/ - -void add_remove(unsigned int *map, t_fillist *list, int size) -{ - unsigned int mask; - unsigned short tetri; - int i; - int j; - - tetri = list->tetribit; - mask = ~0u << (32 - list->width); - i = (list->height - 1) * list->width; - j = (list->height - 1) * size + list->position; - while (j >= list->position) - { - map[(j - 1) / 32] ^= (mask & tetri << (16 + i)) >> (j - 1); - map[(j - 1) / 32 + 1] ^= (mask & tetri << (16 + i)) << (32 - j) << 1; - j -= size; - i -= list->width; - } -} - -/* -** Test optimisation for not testing wrong maps when tetri are identical -*/ - -int check_tetri_memory(t_fillist *list, int pos) -{ - t_fillist *tetri; - unsigned int mask; - - tetri = list; - mask = 1 << ((pos % 32) - 1); - if (tetri->same) - { - if (!(tetri->same->memory[pos / 32] & mask)) - return (tetri->same->memory[pos / 32] |= mask); - } - else - { -// if (!(tetri->memory[pos / 32] & mask)) - return (tetri->memory[pos / 32] |= mask); - } - return (0); -} - -void remove_tetri_memory(t_fillist *list, int pos) -{ - t_fillist *tetri; - unsigned int mask; - - tetri = list; - mask = 1 << ((pos % 32) - 1); - if (tetri->same != NULL) - { - if ((tetri->same->memory[pos / 32] & mask)) - tetri->same->memory[pos / 32] ^= mask; - } - else - { - if ((tetri->memory[pos / 32] & mask)) - tetri->memory[pos / 32] ^= mask; - } -} - -/* -** Function that recursively try to fill the map with the tetris -*/ - -int fill_map(unsigned int *map, t_fillist *list, int size, t_fillist *link) -{ - if (!list) - return (1); - list->position = 0; - while (find_place(map, list, size)) - { - add_remove(map, list, size); - - list->test = 1; // DEBUG -// print_final_map(link, size, 1); // DEBUG -// ft_putchar('\n'); // DEBUG - -// if (check_tetri_memory(list, list->position)) - if (fill_map(map, list->next, size, link)) - return (1); - add_remove(map, list, size); -// remove_tetri_memory(list, list->position); - - list->test = 0; // DEBUG - - } - return (0); -} - -/* -** Test optimisation for not testing wrong maps when tetri are identical -*/ - -int compare_tetri(t_fillist *tetri_a, t_fillist *tetri_b) -{ - if (tetri_a->tetribit != tetri_b->tetribit) - return (0); - if (tetri_a->width != tetri_b->width) - return (0); - if (tetri_a->height != tetri_b->height) - return (0); - return (1); -} - -/* -** Test optimisation for not testing wrong maps when tetri are identical -*/ - -int check_same_tetri(t_fillist *list, int num) -{ - t_fillist *curr_tetri; - t_fillist *next_tetri; - int i; - - curr_tetri = list; - while (curr_tetri != NULL) - { - i = 0; - if (!(curr_tetri->memory = (unsigned int *)malloc(sizeof(*curr_tetri->memory) * num))) - return (0); - while (i < num) - curr_tetri->memory[i++] = 0; - next_tetri = curr_tetri->next; - while (next_tetri != NULL) - { - if (compare_tetri(curr_tetri, next_tetri)) - if (next_tetri->same == NULL) - next_tetri->same = curr_tetri; - next_tetri = next_tetri->next; - } - curr_tetri = curr_tetri->next; - } - return (0); -} - -/* -** function that send to "fill_map" a map of a certain size and increment its size untill it's solved -*/ - -int search_map(t_fillist *list) -{ - t_fillist *tmp; - unsigned int *map; - int size; - int num; - int i; - - /////////////////////////////////////////////////// TEST - unsigned int print; - tmp = list; - while (tmp) - { - // imression pour tests - check_same_tetri(list, 1); - print = tmp->tetribit; - print <<= 16; - print_map(&print, tmp->width, tmp->height, tmp->letter); - if (tmp->same) - { - print = tmp->same->tetribit; - print <<= 16; - ft_putstr("same --> "); - ft_putchar(tmp->same->letter); - ft_putchar('\n'); - } - ft_putchar('\n'); - tmp = tmp->next; - } - /////////////////////////////////////////////////// TEST - - size = 2; - num = 1; - tmp = list; - while ((tmp = tmp->next)) - num++; - while (size * size < num * 4) - size++; - i = 0; - while (!i) - { - ft_putnbrendl(size); - num = (size * size) / 32 + 1; - if (!(map = (unsigned int *)malloc(sizeof(*map) * num))) - return (0); - check_same_tetri(list, num); - while (num) - map[num--] = 0; - i = fill_map(map, list, size++, list); - } - ft_putendl("result in binary :"); // DEBUG (pas dans le main car besoin de map) - print_map(map, size - 1, size - 1, '#'); // DEBUG - return (--size); -}