diff --git a/fillit.c b/fillit.c index 29601f5..2d12a69 100644 --- a/fillit.c +++ b/fillit.c @@ -63,3 +63,40 @@ t_map *map_initialization(char **tetramino_table) clear_map(map); return (map); } + +void insert_tetramino(t_map *map, int index) +{ + int i; + int k; + t_tetraminos *temp; + + temp = map->figure[index]; + i = temp->offset_y; + k = i + 4; + while (i < k) + { + map->line[i] |= temp->line[i]; + i++; + } +} + + +void erase_tetramino(t_map *map, int index) +{ + int i; + int k; + t_tetraminos *temp; + + temp = map->figure[index]; + i = temp->offset_y; + k = 0; + while (k < 4) + { + map->line[i + k] ^= temp->line[i + k]; + k++; + } +} + +void algorithm(t_map *map) +{ +}