From 1a16e305d381c54df49bf9327c30fd7e2982fe7a Mon Sep 17 00:00:00 2001 From: Hugo LAMY Date: Tue, 21 May 2019 15:31:04 +0200 Subject: [PATCH] a une ligne pret le programme fonctionne tout le temps aaaarg --- samples/jdugoudr | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ search_map.c | 16 ++++++++- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 samples/jdugoudr diff --git a/samples/jdugoudr b/samples/jdugoudr new file mode 100644 index 0000000..b1d432f --- /dev/null +++ b/samples/jdugoudr @@ -0,0 +1,89 @@ +...# +...# +...# +...# + +#... +##.. +.#.. +.... + +.... +###. +#... +.... + +#### +.... +.... +.... + +.##. +##.. +.... +.... + +##.. +.##. +.... +.... + +...# +...# +...# +...# + +#... +##.. +.#.. +.... + +.... +###. +#... +.... + +...# +...# +...# +...# + +#... +##.. +.#.. +.... + +.... +###. +#... +.... + +#### +.... +.... +.... + +.##. +##.. +.... +.... + +##.. +.##. +.... +.... + +...# +...# +...# +...# + +#... +##.. +.#.. +.... + +.... +###. +#... +.... diff --git a/search_map.c b/search_map.c index fb36681..6acebf1 100644 --- a/search_map.c +++ b/search_map.c @@ -6,7 +6,7 @@ /* By: hulamy +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/04/27 20:47:22 by hulamy #+# #+# */ -/* Updated: 2019/05/20 15:50:12 by hulamy ### ########.fr */ +/* Updated: 2019/05/21 15:27:37 by hulamy ### ########.fr */ /* */ /* ************************************************************************** */ @@ -231,6 +231,19 @@ int check_tetri_memory(t_fillist *list, int pos) return (0); } +void remove_tetri_memory(t_fillist *list, int pos) +{ + t_fillist *tetri; + unsigned int mask; + + tetri = list; + mask = 1 << ((pos % 32) - 1); + if (tetri->same != NULL) + tetri->same->memory[pos / 32] ^= mask; + else + tetri->memory[pos / 32] ^= mask; +} + /* ** Function that recursively try to fill the map with the tetris */ @@ -247,6 +260,7 @@ int fill_map(unsigned int *map, t_fillist *list, int size) if (fill_map(map, list->next, size)) return (1); add_remove(map, list, size); +// remove_tetri_memory(list, list->position); } return (0); }