Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bdc944da9 | ||
|
|
f29d9d8e60 | ||
|
|
f79d3812d0 | ||
|
|
56ca478503 | ||
|
|
04a4fef38b | ||
|
|
e7e944f1ac | ||
|
|
819a14407d | ||
|
|
2bc1f50b46 | ||
|
|
7a07d84d6c | ||
|
|
0236573b6d | ||
|
|
fb1a41e94f | ||
|
|
6ca294272f | ||
|
|
bfd23d6211 | ||
|
|
fa5f2e7f00 | ||
|
|
246906a490 | ||
|
|
eea8110abd | ||
|
|
79a5fb188c | ||
|
|
59d2be2756 | ||
|
|
c82ba9bccb | ||
|
|
ed06e3eb8e | ||
|
|
2dfe395a9b | ||
|
|
77656ba113 | ||
|
|
a9e62833bb | ||
|
|
6b9936b0cd | ||
|
|
1a16e305d3 | ||
|
|
1811268725 | ||
|
|
184981a28d | ||
|
|
c2e87b7303 | ||
|
|
2dbd5b7320 | ||
|
|
0912e52a7a | ||
|
|
f4b1da414c | ||
|
|
a639da4ac5 | ||
|
|
b9bdc14db7 | ||
|
|
8a62783a6b | ||
|
|
1c6e41e8bf | ||
|
|
3977a73682 | ||
|
|
4a7ad39626 | ||
|
|
fe191054c9 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -13,3 +13,7 @@ a\.out
|
||||
fillit
|
||||
|
||||
test_fillit\.c
|
||||
|
||||
libft
|
||||
|
||||
\.DS_Store
|
||||
|
||||
2
Makefile
2
Makefile
@@ -6,7 +6,7 @@
|
||||
# By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2019/03/01 13:24:35 by vmanzoni #+# #+# #
|
||||
# Updated: 2019/05/17 17:11:53 by hulamy ### ########.fr #
|
||||
# Updated: 2019/05/29 14:03:03 by vmanzoni ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
|
||||
@@ -18,5 +18,7 @@ Le but de ce projet est d’agencer les Tetriminos entre eux pour former le plus
|
||||
|
||||
## BONUS
|
||||
- [x] Best error handler (more details on why there is an error.)
|
||||
- [ ] Optimisation
|
||||
- [ ] Add colors to tetri when printing result map
|
||||
- [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)
|
||||
|
||||
100
f_bonus_opti.c
Normal file
100
f_bonus_opti.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* bonus.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/05/24 14:42:46 by hulamy #+# #+# */
|
||||
/* Updated: 2019/06/01 14:11:32 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 =
|
||||
(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 (0);
|
||||
}
|
||||
78
f_bonus_print.c
Normal file
78
f_bonus_print.c
Normal file
@@ -0,0 +1,78 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* f_bonus_print.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/05/27 13:46:29 by hulamy #+# #+# */
|
||||
/* Updated: 2019/06/01 15:00:01 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "fillit.h"
|
||||
|
||||
/*
|
||||
** function that print the given tetris if flag p is present
|
||||
*/
|
||||
|
||||
t_fillist *print_tetri(t_fillist *list)
|
||||
{
|
||||
unsigned int print;
|
||||
t_fillist *tmp;
|
||||
|
||||
tmp = list;
|
||||
if (list->dope[2])
|
||||
{
|
||||
while (tmp)
|
||||
{
|
||||
check_same_tetri(list, 1);
|
||||
print = tmp->tetribit;
|
||||
print <<= 16;
|
||||
print_sized_map(&print, tmp->width, tmp->height, tmp->letter);
|
||||
if (tmp->same && list->dope[1])
|
||||
{
|
||||
print = tmp->same->tetribit;
|
||||
print <<= 16;
|
||||
ft_putstr("same --> ");
|
||||
ft_put_tetri_color(tmp->same->letter);
|
||||
ft_putchar('\n');
|
||||
}
|
||||
ft_putchar('\n');
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
return (list);
|
||||
}
|
||||
|
||||
/*
|
||||
** 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);
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* handle_errors.c :+: :+: :+: */
|
||||
/* f_handle_errors.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/03/01 13:29:05 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/05/03 19:11:02 by vmanzoni ### ########.fr */
|
||||
/* Updated: 2019/06/01 14:49:01 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,31 +16,36 @@
|
||||
** Function that display error message *s on fd and exit program
|
||||
*/
|
||||
|
||||
void print_error(char *s)
|
||||
void print_error(char *str)
|
||||
{
|
||||
write(2, s, strlen(s));
|
||||
exit(1);
|
||||
write(1, str, ft_strlen(str));
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
** Function that display error message *s on fd
|
||||
** with more informations
|
||||
** and exit program
|
||||
** Function that display error message *s on fd with more informations
|
||||
*/
|
||||
|
||||
void print_error_extended(int error)
|
||||
void print_error_extended(int error, int *dope)
|
||||
{
|
||||
if (!dope[3])
|
||||
print_error("error\n");
|
||||
if (error == 1)
|
||||
ft_putstr("error: File contains char other than . # \\n found.\n");
|
||||
print_error("error: File contains char other than '.','#' and '\\n'\n");
|
||||
if (error == 2)
|
||||
ft_putstr("error: File contains more than 2 \\n in a row.\n");
|
||||
print_error("error: File contains two tetriminos not"
|
||||
"separated by a '\\n'\n");
|
||||
if (error == 3)
|
||||
ft_putstr("error: File contains less than 1 tetrimino or more than 26.\n");
|
||||
print_error("error: File contains more than 2 '\\n' in a row\n");
|
||||
if (error == 4)
|
||||
ft_putstr("\n\nerror: This tetrimino has more or less than 4 #.\n");
|
||||
print_error("error: File contains less than 1 tetrimino\n");
|
||||
if (error == 5)
|
||||
ft_putstr("\n\nerror: This tetrimino # are not well connected.\n");
|
||||
exit(1);
|
||||
print_error("error: File contains more than 26 tetriminos\n");
|
||||
if (error == 6)
|
||||
print_error("error: Tetrimino has more or less than 4 #\n");
|
||||
if (error == 7)
|
||||
print_error("error: Tetrimino # are not all connected\n");
|
||||
print_error("error\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -50,7 +55,7 @@ void print_error_extended(int error)
|
||||
** - two \n in a row
|
||||
*/
|
||||
|
||||
int check_file_errors(char *file)
|
||||
void check_file_errors(char *file, int *dope)
|
||||
{
|
||||
int i;
|
||||
int line_nbr;
|
||||
@@ -60,17 +65,20 @@ int check_file_errors(char *file)
|
||||
while (file[i])
|
||||
{
|
||||
if (file[i] != '.' && file[i] != '#' && file[i] != '\n')
|
||||
return (1);
|
||||
if (file[i] == '\n')
|
||||
print_error_extended(1, dope);
|
||||
else if (file[i] == '\n')
|
||||
line_nbr++;
|
||||
if (file[i] == '\n' && file[i+1] != '\0' && \
|
||||
file[i+2] != '.' && file[i+2] != '#')
|
||||
return (2);
|
||||
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)
|
||||
return (3);
|
||||
return (0);
|
||||
if (line_nbr < 4)
|
||||
print_error_extended(4, dope);
|
||||
if (!dope[3] && line_nbr > 129)
|
||||
print_error_extended(5, dope);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -97,7 +105,7 @@ int check_tetri_errors(char *tetri)
|
||||
i++;
|
||||
}
|
||||
if (htg != 4 || dot != 12 || check_tetri_errors_proxy(tetri))
|
||||
return (4 + check_tetri_errors_proxy(tetri));
|
||||
return (6 + check_tetri_errors_proxy(tetri));
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -108,17 +116,21 @@ int check_tetri_errors(char *tetri)
|
||||
int check_tetri_errors_proxy(char *tetri)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
i = 0;
|
||||
j = 0;
|
||||
while (tetri[i])
|
||||
{
|
||||
if (tetri[i] == '.' || tetri[i] == '\n')
|
||||
i++;
|
||||
else if (tetri[i] == '#' && (tetri[i + 1] == '#' || tetri[i - 1] == '#'
|
||||
|| tetri[i + 5] == '#' || tetri[i - 5] == '#'))
|
||||
i++;
|
||||
else
|
||||
return (1);
|
||||
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 (0);
|
||||
return ((j < 6) ? 1 : 0);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/15 14:48:14 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/05/16 15:30:57 by hulamy ### ########.fr */
|
||||
/* Updated: 2019/06/01 13:32:38 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -44,10 +44,7 @@ unsigned short reduce_tetri(unsigned short tetri, int width)
|
||||
unsigned int mask;
|
||||
unsigned int tmp;
|
||||
|
||||
// cree un mask avec des 1 a gauche sur la largeur du tetriminos
|
||||
mask = ~0u << (32 - width) >> 16;
|
||||
// fabrique la ligne pour le tetriminos de la bonne largeur
|
||||
tmp = tetri;
|
||||
tmp = (mask & tetri);
|
||||
tmp |= ((mask & tetri << 4) >> width);
|
||||
tmp |= ((mask & tetri << 8) >> (2 * width));
|
||||
@@ -58,18 +55,27 @@ unsigned short reduce_tetri(unsigned short tetri, int width)
|
||||
/*
|
||||
** 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)
|
||||
void fill_list(char line[], t_fillist *list)
|
||||
{
|
||||
unsigned int mask;
|
||||
int i;
|
||||
|
||||
// transforme la ligne de . et # en un short de 0 et 1
|
||||
list->tetribit = tab_to_bin(line);
|
||||
// cree un mask avec des 1 sur la colonne de droite (#...#...#...#...)
|
||||
list->memory = 0;
|
||||
mask = (1 << 15) | (1 << 11) | (1 << 7) | (1 << 3);
|
||||
// utilise le mask pour trouver la largeur que prend le tetriminos
|
||||
i = 0;
|
||||
while (!(mask & list->tetribit) && i++ < 4)
|
||||
mask >>= 1;
|
||||
@@ -77,20 +83,16 @@ void fill_list(char line[], t_fillist *list)
|
||||
while (mask & list->tetribit && ++i < 4)
|
||||
mask >>= 1;
|
||||
list->width = i - list->width;
|
||||
// deplace le tetriminos tout en haut a gauche
|
||||
//(i - list->width = le nombre de colonne vide a gauche)
|
||||
list->tetribit <<= (i - list->width);
|
||||
while (!(list->tetribit & (~0u << 12)))
|
||||
list->tetribit <<= 4;
|
||||
// trouve la hauteur du tetri
|
||||
i = 0;
|
||||
while (i < 4 && list->tetribit & (~0u << 28 >> (i * 4 + 16)))
|
||||
i++;
|
||||
list->height = i;
|
||||
// fabrique la ligne pour le tetriminos de la bonne largeur
|
||||
list->tetribit = reduce_tetri(list->tetribit, list->width);
|
||||
list->position = 0;
|
||||
list->test = 0; // DEBUG pour que print_final_map puisse imprimer correctement au fur et a mesure
|
||||
list->same = NULL;
|
||||
list->test = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -98,7 +100,7 @@ void fill_list(char line[], t_fillist *list)
|
||||
** linked each time needed
|
||||
*/
|
||||
|
||||
int add_to_list(char *line, t_fillist **list, char letter)
|
||||
int add_to_list(char *line, t_fillist **lst, char letter, int *dope)
|
||||
{
|
||||
t_fillist *tmp;
|
||||
t_fillist *test;
|
||||
@@ -106,17 +108,19 @@ int add_to_list(char *line, t_fillist **list, char letter)
|
||||
if (!(tmp = (t_fillist*)malloc(sizeof(*tmp))))
|
||||
return (0);
|
||||
tmp->next = NULL;
|
||||
test = *list;
|
||||
test = *lst;
|
||||
if (!test)
|
||||
*list = tmp;
|
||||
*lst = tmp;
|
||||
else
|
||||
{
|
||||
while(test->next)
|
||||
while (test->next)
|
||||
test = test->next;
|
||||
test->next = tmp;
|
||||
}
|
||||
fill_list(line, tmp);
|
||||
tmp->letter = letter;
|
||||
tmp->dope = dope;
|
||||
tmp->start = *lst;
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -124,13 +128,13 @@ int add_to_list(char *line, t_fillist **list, char letter)
|
||||
** Function that parse a file and put each tetrimino in a linked list
|
||||
*/
|
||||
|
||||
void parse_input(char *input)
|
||||
int parse_input(char *input, t_fillist **list, int *dope)
|
||||
{
|
||||
static t_fillist *list = NULL;
|
||||
char tetri[20];
|
||||
int i;
|
||||
int j;
|
||||
int letter;
|
||||
int size;
|
||||
|
||||
i = 0;
|
||||
letter = 'A';
|
||||
@@ -141,14 +145,11 @@ void parse_input(char *input)
|
||||
tetri[j++] = input[i++];
|
||||
tetri[19] = '\0';
|
||||
if (check_tetri_errors(tetri))
|
||||
{
|
||||
ft_putstr(tetri);
|
||||
print_error_extended(check_tetri_errors(tetri));
|
||||
//print_error("\n\nerror: This tetrimino is not valid.\n");
|
||||
}
|
||||
add_to_list(tetri, &list, letter++);
|
||||
print_error_extended(check_tetri_errors(tetri), dope);
|
||||
add_to_list(tetri, list, letter++, dope);
|
||||
while (input[i] && input[i] != '.' && input[i] != '#')
|
||||
i++;
|
||||
}
|
||||
search_map(list);
|
||||
size = search_map(*list);
|
||||
return (size);
|
||||
}
|
||||
@@ -6,61 +6,18 @@
|
||||
/* By: hulamy <hulamy@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/30 13:24:28 by hulamy #+# #+# */
|
||||
/* Updated: 2019/05/16 15:52:52 by hulamy ### ########.fr */
|
||||
/* Updated: 2019/06/01 13:56:50 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "fillit.h"
|
||||
|
||||
/*
|
||||
** DELETE BEFORE EVAL - TEST FUNCTION
|
||||
** Prints a ligne of size bits
|
||||
** function that print a map of height and width
|
||||
** usefull to print tetris
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
** DELETE BEFORE EVAL - TEST FUNCTION
|
||||
** Prints a tetri from its bit form
|
||||
*/
|
||||
|
||||
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);
|
||||
write(1, " ", 1);
|
||||
mask >>= 1;
|
||||
i++;
|
||||
}
|
||||
write(1, "\n", 1);
|
||||
}
|
||||
|
||||
/*
|
||||
** DELETE BEFORE EVAL - TEST FUNCTION
|
||||
** Print a map of height and width
|
||||
*/
|
||||
|
||||
void print_map(unsigned int *tab, int width, int height, char letter)
|
||||
void print_sized_map(unsigned int *tab, int width, int height, char letter)
|
||||
{
|
||||
int i;
|
||||
unsigned int mask;
|
||||
@@ -74,7 +31,10 @@ void print_map(unsigned int *tab, int width, int height, char letter)
|
||||
{
|
||||
if (i && !(i % width))
|
||||
ft_putchar('\n');
|
||||
tab[i / 32] & (1 << (31 - i % 32)) ? ft_put_tetri_color(letter) : ft_putchar('.');
|
||||
if (tab[i / 32] & (1 << (31 - i % 32)))
|
||||
ft_put_tetri_color(letter);
|
||||
else
|
||||
ft_putchar('.');
|
||||
ft_putchar(' ');
|
||||
i++;
|
||||
}
|
||||
@@ -83,42 +43,79 @@ void print_map(unsigned int *tab, int width, int height, char letter)
|
||||
|
||||
/*
|
||||
** Print the final map with the letters
|
||||
** if flag value is 0 -> print moulinette version
|
||||
** if flag value is 0 -> print in color
|
||||
*/
|
||||
|
||||
void print_final_map(t_fillist *list, int size)
|
||||
char *init_print_map(t_fillist *list, int size)
|
||||
{
|
||||
// unsigned int print; // DEBUG
|
||||
t_fillist *tmp;
|
||||
char *map;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
map = (char *)malloc(sizeof(*map) * (size * size + 1));
|
||||
map[size*size] = '\0';
|
||||
map[size * size] = '\0';
|
||||
i = -1;
|
||||
while (++i < size * size)
|
||||
map[i] = '.';
|
||||
tmp = list;
|
||||
while (tmp)
|
||||
while (list)
|
||||
{
|
||||
j = 0;
|
||||
i = -1;
|
||||
while (++i < tmp->width * tmp->height)
|
||||
while (++i < list->width * list->height)
|
||||
{
|
||||
if (i && i % tmp->width == 0)
|
||||
j += size - tmp->width;
|
||||
if (1 << (15 - i) & tmp->tetribit/* && tmp->test == 1*/) // DEBUG "&& tmp->position != -1" pour imprimer les bonnes lettres au coours du debug
|
||||
map[tmp->position + i + j - 1] = tmp->letter;
|
||||
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;
|
||||
}
|
||||
tmp = tmp->next;
|
||||
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');
|
||||
ft_put_tetri_color(map[i]);
|
||||
ft_putchar(' ');
|
||||
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');
|
||||
}
|
||||
@@ -6,73 +6,46 @@
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/05/03 20:27:22 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/05/04 19:15:35 by vmanzoni ### ########.fr */
|
||||
/* Updated: 2019/06/01 14:27:30 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "fillit.h"
|
||||
|
||||
void ft_putchar(char c)
|
||||
void ft_putchar_color(char c, char color)
|
||||
{
|
||||
write(1, &c, 1);
|
||||
}
|
||||
|
||||
void ft_putchar_red(char c)
|
||||
{
|
||||
write(1, RED, 5);
|
||||
ft_putchar(c);
|
||||
write(1, RESET, 5);
|
||||
}
|
||||
|
||||
void ft_putchar_blue(char c)
|
||||
{
|
||||
write(1, BLU, 5);
|
||||
ft_putchar(c);
|
||||
write(1, RESET, 5);
|
||||
}
|
||||
|
||||
void ft_putchar_green(char c)
|
||||
{
|
||||
write(1, GRN, 5);
|
||||
ft_putchar(c);
|
||||
write(1, RESET, 5);
|
||||
}
|
||||
|
||||
void ft_putchar_yellow(char c)
|
||||
{
|
||||
write(1, YEL, 5);
|
||||
ft_putchar(c);
|
||||
write(1, RESET, 5);
|
||||
}
|
||||
|
||||
void ft_putchar_magenta(char c)
|
||||
{
|
||||
write(1, MAG, 5);
|
||||
ft_putchar(c);
|
||||
write(1, RESET, 5);
|
||||
}
|
||||
|
||||
void ft_putchar_cyan(char c)
|
||||
{
|
||||
write(1, CYN, 5);
|
||||
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')
|
||||
ft_putchar_red(c);
|
||||
else if (c == 'B' || c == 'H' || c == 'N' || c == 'T' || c == 'Y')
|
||||
ft_putchar_blue(c);
|
||||
else if (c == 'C' || c == 'I' || c == 'O' || c == 'U' || c == 'Z')
|
||||
ft_putchar_green(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_yellow(c);
|
||||
ft_putchar_color(c, 'Y');
|
||||
else if (c == 'E' || c == 'K' || c == 'Q' || c == 'W')
|
||||
ft_putchar_magenta(c);
|
||||
ft_putchar_color(c, 'M');
|
||||
else if (c == 'F' || c == 'L' || c == 'R' || c == 'X')
|
||||
ft_putchar_cyan(c);
|
||||
ft_putchar_color(c, 'C');
|
||||
else
|
||||
ft_putchar(c);
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/13 12:09:46 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/04/22 15:16:18 by vmanzoni ### ########.fr */
|
||||
/* Updated: 2019/06/01 15:12:03 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
|
||||
char *read_file(char *file)
|
||||
{
|
||||
char buf[BUFF_SIZE];
|
||||
int fd;
|
||||
int rv;
|
||||
int i;
|
||||
char *result;
|
||||
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)))
|
||||
|| !(result = malloc(sizeof(char) * rv)))
|
||||
return (NULL);
|
||||
buf[rv] = '\0';
|
||||
buf[rv - 1] = '\0';
|
||||
i = -1;
|
||||
while (buf[++i])
|
||||
result[i] = buf[i];
|
||||
@@ -36,3 +36,15 @@ char *read_file(char *file)
|
||||
close(fd);
|
||||
return (result);
|
||||
}
|
||||
|
||||
/*
|
||||
** Function that init num and size for search_map
|
||||
*/
|
||||
|
||||
void init_num_and_size(int num, int *size, t_fillist *tmp)
|
||||
{
|
||||
while ((tmp = tmp->next))
|
||||
num++;
|
||||
while (*size * *size < num * 4)
|
||||
(*size)++;
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* search_map.c :+: :+: :+: */
|
||||
/* f_search_map.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <hulamy@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/27 20:47:22 by hulamy #+# #+# */
|
||||
/* Updated: 2019/05/17 17:06:41 by hulamy ### ########.fr */
|
||||
/* Updated: 2019/06/01 15:12:08 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
** 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 fit_in_place(unsigned int *map, t_fillist *lst, int sze, int i)
|
||||
{
|
||||
unsigned int tmp;
|
||||
unsigned int mask;
|
||||
@@ -36,9 +36,11 @@ unsigned int fit_in_place(unsigned int *map, t_fillist *lst, int size, int i)
|
||||
return (0);
|
||||
if (r >= 32 && ++n)
|
||||
r -= 32;
|
||||
tmp = (mask & (map[n] << r)) | (mask & (map[n + 1] >> (32 - r)));
|
||||
tmp = (mask & (map[n] << r));
|
||||
if (n + 1 < lst->total_num)
|
||||
tmp |= (mask & (map[n + 1] >> (32 - r)));
|
||||
tetri <<= lst->width;
|
||||
r += size;
|
||||
r += sze;
|
||||
}
|
||||
return (!(tmp & tetri));
|
||||
}
|
||||
@@ -47,7 +49,7 @@ unsigned int fit_in_place(unsigned int *map, t_fillist *lst, int size, int i)
|
||||
** 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 find_place(unsigned int *map, t_fillist *list, int size)
|
||||
{
|
||||
int limit;
|
||||
int pos;
|
||||
@@ -80,32 +82,32 @@ int find_place(unsigned int *map, t_fillist *list, int size)
|
||||
** function that add or remove a tetri on the map
|
||||
*/
|
||||
|
||||
void add_remove(unsigned int *map, t_fillist *list, int size)
|
||||
void add_remove(unsigned int *map, t_fillist *list, int size)
|
||||
{
|
||||
unsigned int mask;
|
||||
unsigned int msk;
|
||||
unsigned short tetri;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
tetri = list->tetribit;
|
||||
mask = ~0u << (32 - list->width);
|
||||
msk = ~0u << (32 - list->width);
|
||||
i = (list->height - 1) * list->width;
|
||||
j = (list->height - 1) * size + list->position;
|
||||
// change les bits du tetri sur la map a la position donnee
|
||||
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;
|
||||
map[(j - 1) / 32] ^= (msk & tetri << (16 + i)) >> (j - 1);
|
||||
if ((j - 1) / 32 + 1 < list->total_num)
|
||||
map[(j - 1) / 32 + 1] ^= (msk & tetri << (16 + i)) << (32 - j) << 1;
|
||||
j -= size;
|
||||
i -= list->width;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** function that recursively try to fill the map with the tetris
|
||||
** Function that recursively try to fill the map with the tetris
|
||||
*/
|
||||
|
||||
int fill_map(unsigned int *map, t_fillist *list, int size)
|
||||
int fill_map(unsigned int *map, t_fillist *list, int size)
|
||||
{
|
||||
if (!list)
|
||||
return (1);
|
||||
@@ -113,18 +115,31 @@ int fill_map(unsigned int *map, t_fillist *list, int size)
|
||||
while (find_place(map, list, size))
|
||||
{
|
||||
add_remove(map, list, size);
|
||||
if (fill_map(map, list->next, size))
|
||||
return (1);
|
||||
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
|
||||
** 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)
|
||||
int search_map(t_fillist *list)
|
||||
{
|
||||
t_fillist *tmp;
|
||||
unsigned int *map;
|
||||
@@ -132,38 +147,21 @@ int search_map(t_fillist *list)
|
||||
int num;
|
||||
int i;
|
||||
|
||||
/////////////////////////////////////////////////// TEST
|
||||
unsigned int print;
|
||||
tmp = list;
|
||||
while (tmp)
|
||||
{
|
||||
// imression pour tests
|
||||
print = tmp->tetribit;
|
||||
print <<= 16;
|
||||
print_map(&print, tmp->width, tmp->height, tmp->letter);
|
||||
ft_putchar('\n');
|
||||
tmp = tmp->next;
|
||||
}
|
||||
/////////////////////////////////////////////////// TEST
|
||||
|
||||
size = 2;
|
||||
num = 1;
|
||||
tmp = list;
|
||||
while ((tmp = tmp->next))
|
||||
num++;
|
||||
while (size * size < num * 4)
|
||||
size++;
|
||||
tmp = print_tetri(list);
|
||||
init_num_and_size(1, &size, tmp);
|
||||
i = 0;
|
||||
while (!i)
|
||||
{
|
||||
num = (size * size) / 32 + 1;
|
||||
if (!(map = (unsigned int *)malloc(sizeof(*map) * num)))
|
||||
return (0);
|
||||
while (num)
|
||||
map[num--] = 0;
|
||||
check_same_tetri(list, num);
|
||||
while (num--)
|
||||
map[num] = 0;
|
||||
i = fill_map(map, list, size++);
|
||||
if (!i)
|
||||
free(map);
|
||||
}
|
||||
print_final_map(list, size - 1); // DEBUG
|
||||
print_map(map, size - 1, size - 1, '#'); // DEBUG
|
||||
return (--size);
|
||||
return (print_binary_map(map, size, list->dope));
|
||||
}
|
||||
20
fillit.dSYM/Contents/Info.plist
Normal file
20
fillit.dSYM/Contents/Info.plist
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.apple.xcode.dsym.fillit</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>dSYM</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
132
fillit.h
132
fillit.h
@@ -6,19 +6,19 @@
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/03/01 13:34:46 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/05/17 17:03:35 by hulamy ### ########.fr */
|
||||
/* Updated: 2019/06/01 15:12:00 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef FILLIT_H
|
||||
# define FILLIT_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h> // for system call write
|
||||
#include <fcntl.h> // for system call open
|
||||
#include <stdio.h> // for printf (DELETE BEFORE EVAL)
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
# include <fcntl.h>
|
||||
# include <stdbool.h>
|
||||
|
||||
#include "libft/includes/libft.h"
|
||||
# include "libft/includes/libft.h"
|
||||
|
||||
/*
|
||||
** DEFINE
|
||||
@@ -26,19 +26,32 @@
|
||||
|
||||
# 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"
|
||||
# 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"
|
||||
|
||||
/*
|
||||
** 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 :
|
||||
** 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
|
||||
typedef struct s_fillist
|
||||
{
|
||||
unsigned short tetribit;
|
||||
int width;
|
||||
@@ -47,29 +60,84 @@ typedef struct s_fillist
|
||||
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;
|
||||
} t_fillist;
|
||||
struct s_fillist *start;
|
||||
} t_fillist;
|
||||
|
||||
/*
|
||||
** FUNCTIONS
|
||||
** 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);
|
||||
|
||||
char *read_file(char *file);
|
||||
void print_error(char *s);
|
||||
void print_error_extended(int error);
|
||||
void parse_input(char *input);
|
||||
int check_file_errors(char *file);
|
||||
int check_tetri_errors(char *tetri);
|
||||
int check_tetri_errors_proxy(char *tetri);
|
||||
int add_to_list(char *square, t_fillist **list, char letter);
|
||||
void fill_list(char line[], t_fillist *list);
|
||||
void print_bits(unsigned int bits, int size); //TO DELETE BEFORE EVAL
|
||||
void print_tetri(unsigned int bits, int size); //TO DELETE BEFORE EVAL
|
||||
int search_map(t_fillist *list);
|
||||
void print_map(unsigned int *tab, int width, int height, char letter);
|
||||
void print_final_map(t_fillist *list, int size);
|
||||
void ft_put_tetri_color(char c);
|
||||
/*
|
||||
** bonus_print.c
|
||||
*/
|
||||
t_fillist *print_tetri(t_fillist *list);
|
||||
int print_binary_map(unsigned int *map, int size, int *dope);
|
||||
int print_flags_usage(void);
|
||||
|
||||
/*
|
||||
** main.c
|
||||
*/
|
||||
int *create_dope(char *av, int mdp);
|
||||
int is_mdp(int ac, char **av);
|
||||
void clean_list(t_fillist *list, t_fillist *tmp);
|
||||
int main(int argc, char **argv);
|
||||
|
||||
/*
|
||||
** read_file.c
|
||||
*/
|
||||
char *read_file(char *file);
|
||||
void init_num_and_size(int num, int *size, t_fillist *tmp);
|
||||
|
||||
/*
|
||||
** 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
|
||||
*/
|
||||
unsigned short tab_to_bin(char line[]);
|
||||
unsigned short reduce_tetri(unsigned short tetri, int width);
|
||||
void fill_list(char line[], t_fillist *list);
|
||||
int add_to_list(char *sqr, t_fillist **lst, char lett, int *dope);
|
||||
int parse_input(char *input, t_fillist **list, int *dope);
|
||||
|
||||
/*
|
||||
** 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 wdth, int hgt, char ltr);
|
||||
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);
|
||||
|
||||
/*
|
||||
** print_map_with_colors.c
|
||||
*/
|
||||
void ft_putchar_color(char c, char color);
|
||||
void ft_put_tetri_color(char c);
|
||||
|
||||
#endif
|
||||
|
||||
109
main.c
109
main.c
@@ -6,30 +6,109 @@
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/02/12 13:20:48 by vmanzoni #+# #+# */
|
||||
/* Updated: 2019/05/03 19:12:47 by vmanzoni ### ########.fr */
|
||||
/* Updated: 2019/06/01 14:40:58 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "fillit.h"
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char *input;
|
||||
/*
|
||||
** 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 (message more precise AND no error if too much tetri)
|
||||
*/
|
||||
|
||||
if (argc == 2)
|
||||
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)
|
||||
{
|
||||
if (!(input = read_file(argv[1])))
|
||||
print_error("error: Could not read file.\n");
|
||||
if (check_file_errors(input))
|
||||
print_error_extended(check_file_errors(input));
|
||||
// print_error("error: Invalid file.\n");
|
||||
parse_input(input);
|
||||
/*
|
||||
Backtracking for smallest square
|
||||
Transform tetriminos with letters & Print result
|
||||
*/
|
||||
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;
|
||||
mdp = is_mdp(ac, av);
|
||||
dope = create_dope(av[3], mdp);
|
||||
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);
|
||||
}
|
||||
|
||||
79
samples/16square
Normal file
79
samples/16square
Normal file
@@ -0,0 +1,79 @@
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
129
samples/26square
Normal file
129
samples/26square
Normal file
@@ -0,0 +1,129 @@
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
19
samples/4square
Normal file
19
samples/4square
Normal file
@@ -0,0 +1,19 @@
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
24
samples/5square
Normal file
24
samples/5square
Normal file
@@ -0,0 +1,24 @@
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
44
samples/9square
Normal file
44
samples/9square
Normal file
@@ -0,0 +1,44 @@
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
89
samples/debug/jdugoudr
Normal file
89
samples/debug/jdugoudr
Normal file
@@ -0,0 +1,89 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr1
Normal file
84
samples/debug/jdugoudr1
Normal file
@@ -0,0 +1,84 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr10
Normal file
84
samples/debug/jdugoudr10
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr11
Normal file
84
samples/debug/jdugoudr11
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr12
Normal file
84
samples/debug/jdugoudr12
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr13
Normal file
84
samples/debug/jdugoudr13
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr14
Normal file
84
samples/debug/jdugoudr14
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr15
Normal file
84
samples/debug/jdugoudr15
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr16
Normal file
84
samples/debug/jdugoudr16
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr17
Normal file
84
samples/debug/jdugoudr17
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr18
Normal file
79
samples/debug/jdugoudr18
Normal file
@@ -0,0 +1,79 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
79
samples/debug/jdugoudr18_17
Normal file
79
samples/debug/jdugoudr18_17
Normal file
@@ -0,0 +1,79 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
74
samples/debug/jdugoudr18_17_16
Normal file
74
samples/debug/jdugoudr18_17_16
Normal file
@@ -0,0 +1,74 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
69
samples/debug/jdugoudr18_17_16_15
Normal file
69
samples/debug/jdugoudr18_17_16_15
Normal file
@@ -0,0 +1,69 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
64
samples/debug/jdugoudr18_17_16_15_14
Normal file
64
samples/debug/jdugoudr18_17_16_15_14
Normal file
@@ -0,0 +1,64 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
59
samples/debug/jdugoudr18_17_16_15_14_13
Normal file
59
samples/debug/jdugoudr18_17_16_15_14_13
Normal file
@@ -0,0 +1,59 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
54
samples/debug/jdugoudr18_17_16_15_14_13_12
Normal file
54
samples/debug/jdugoudr18_17_16_15_14_13_12
Normal file
@@ -0,0 +1,54 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
49
samples/debug/jdugoudr18_17_16_15_14_13_12_11
Normal file
49
samples/debug/jdugoudr18_17_16_15_14_13_12_11
Normal file
@@ -0,0 +1,49 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
44
samples/debug/jdugoudr18_17_16_15_14_13_12_11_10
Normal file
44
samples/debug/jdugoudr18_17_16_15_14_13_12_11_10
Normal file
@@ -0,0 +1,44 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_10
Normal file
79
samples/debug/jdugoudr1_10
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_11
Normal file
79
samples/debug/jdugoudr1_11
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_12
Normal file
79
samples/debug/jdugoudr1_12
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_13
Normal file
79
samples/debug/jdugoudr1_13
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_14
Normal file
79
samples/debug/jdugoudr1_14
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_15
Normal file
79
samples/debug/jdugoudr1_15
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_16
Normal file
79
samples/debug/jdugoudr1_16
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_17
Normal file
79
samples/debug/jdugoudr1_17
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_18
Normal file
79
samples/debug/jdugoudr1_18
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
79
samples/debug/jdugoudr1_2
Normal file
79
samples/debug/jdugoudr1_2
Normal file
@@ -0,0 +1,79 @@
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
74
samples/debug/jdugoudr1_2_3
Normal file
74
samples/debug/jdugoudr1_2_3
Normal file
@@ -0,0 +1,74 @@
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
69
samples/debug/jdugoudr1_2_3_4
Normal file
69
samples/debug/jdugoudr1_2_3_4
Normal file
@@ -0,0 +1,69 @@
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
64
samples/debug/jdugoudr1_2_3_4_5
Normal file
64
samples/debug/jdugoudr1_2_3_4_5
Normal file
@@ -0,0 +1,64 @@
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
59
samples/debug/jdugoudr1_2_3_4_5_6
Normal file
59
samples/debug/jdugoudr1_2_3_4_5_6
Normal file
@@ -0,0 +1,59 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
54
samples/debug/jdugoudr1_2_3_4_5_6_7
Normal file
54
samples/debug/jdugoudr1_2_3_4_5_6_7
Normal file
@@ -0,0 +1,54 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
49
samples/debug/jdugoudr1_2_3_4_5_6_7_8
Normal file
49
samples/debug/jdugoudr1_2_3_4_5_6_7_8
Normal file
@@ -0,0 +1,49 @@
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
44
samples/debug/jdugoudr1_2_3_4_5_6_7_8_9
Normal file
44
samples/debug/jdugoudr1_2_3_4_5_6_7_8_9
Normal file
@@ -0,0 +1,44 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
39
samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10
Normal file
39
samples/debug/jdugoudr1_2_3_4_5_6_7_8_9_10
Normal file
@@ -0,0 +1,39 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_3
Normal file
79
samples/debug/jdugoudr1_3
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_4
Normal file
79
samples/debug/jdugoudr1_4
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_5
Normal file
79
samples/debug/jdugoudr1_5
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_6
Normal file
79
samples/debug/jdugoudr1_6
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_7
Normal file
79
samples/debug/jdugoudr1_7
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_8
Normal file
79
samples/debug/jdugoudr1_8
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
79
samples/debug/jdugoudr1_9
Normal file
79
samples/debug/jdugoudr1_9
Normal file
@@ -0,0 +1,79 @@
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr2
Normal file
84
samples/debug/jdugoudr2
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr3
Normal file
84
samples/debug/jdugoudr3
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr4
Normal file
84
samples/debug/jdugoudr4
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr5
Normal file
84
samples/debug/jdugoudr5
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr6
Normal file
84
samples/debug/jdugoudr6
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr7
Normal file
84
samples/debug/jdugoudr7
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr8
Normal file
84
samples/debug/jdugoudr8
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
84
samples/debug/jdugoudr9
Normal file
84
samples/debug/jdugoudr9
Normal file
@@ -0,0 +1,84 @@
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
|
||||
.##.
|
||||
##..
|
||||
....
|
||||
....
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
...#
|
||||
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
....
|
||||
|
||||
....
|
||||
###.
|
||||
#...
|
||||
....
|
||||
8
samples/error1
Normal file
8
samples/error1
Normal file
@@ -0,0 +1,8 @@
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
####
|
||||
....
|
||||
....
|
||||
....
|
||||
9
samples/error2
Normal file
9
samples/error2
Normal file
@@ -0,0 +1,9 @@
|
||||
.#..
|
||||
.##.
|
||||
..#.
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
..#.
|
||||
..#.
|
||||
@@ -38,11 +38,6 @@
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
@@ -52,48 +47,3 @@
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
99
samples/map_slack
Normal file
99
samples/map_slack
Normal file
@@ -0,0 +1,99 @@
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
|
||||
#...
|
||||
###.
|
||||
....
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
##..
|
||||
....
|
||||
|
||||
...#
|
||||
...#
|
||||
..##
|
||||
....
|
||||
14
samples/opti_test
Normal file
14
samples/opti_test
Normal file
@@ -0,0 +1,14 @@
|
||||
...#
|
||||
.###
|
||||
....
|
||||
....
|
||||
|
||||
....
|
||||
#...
|
||||
##..
|
||||
.#..
|
||||
|
||||
##..
|
||||
.##.
|
||||
....
|
||||
....
|
||||
19
samples/test_a
Normal file
19
samples/test_a
Normal file
@@ -0,0 +1,19 @@
|
||||
....
|
||||
....
|
||||
#...
|
||||
###.
|
||||
|
||||
..#.
|
||||
..#.
|
||||
.##.
|
||||
....
|
||||
|
||||
.#..
|
||||
.#..
|
||||
.#..
|
||||
.#..
|
||||
|
||||
##..
|
||||
##..
|
||||
....
|
||||
....
|
||||
19
samples/test_opti
Normal file
19
samples/test_opti
Normal file
@@ -0,0 +1,19 @@
|
||||
..#.
|
||||
..#.
|
||||
..##
|
||||
....
|
||||
|
||||
....
|
||||
.##.
|
||||
.##.
|
||||
....
|
||||
|
||||
..#.
|
||||
..#.
|
||||
..##
|
||||
....
|
||||
|
||||
..#.
|
||||
..#.
|
||||
..##
|
||||
....
|
||||
@@ -1,95 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* add_to_list.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: hulamy <hulamy@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/14 15:20:53 by hulamy #+# #+# */
|
||||
/* Updated: 2019/04/30 14:14:32 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "fillit.h"
|
||||
//#include <stdio.h>
|
||||
|
||||
/*
|
||||
** 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);
|
||||
//}
|
||||
105
test_big_map.c
105
test_big_map.c
@@ -1,105 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
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);
|
||||
}
|
||||
125
test_big_tetri.c
125
test_big_tetri.c
@@ -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);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* get_smallest_square.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);
|
||||
}
|
||||
92
test_mask.c
92
test_mask.c
@@ -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);
|
||||
}
|
||||
*/
|
||||
@@ -1,266 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* test_othermethod_fillit.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 <stdio.h>
|
||||
|
||||
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");
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* print_fillit.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: vmanzoni <vmanzoni@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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()
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user