/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* check_map.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: dkaiser grid_size.x) { if (get_tile(map, i, 0) != WALL || get_tile(map, i, map->grid_size.y - 1) != WALL) return (1); i++; } i = 0; while (i < map->grid_size.y) { if (get_tile(map, 0, i) != WALL || get_tile(map, map->grid_size.x - 1, i) != WALL) return (1); i++; } return (0); } static int check_exactly_one(t_tilemap *map, char tile) { int i; int found; found = 0; i = map->grid_size.x * map->grid_size.y - 1; while (i >= 0) { if (map->tiles[i] == tile) found++; i--; } if (found != 1) return (1); return (0); } static int check_collectibles(t_tilemap *map) { int i; i = map->grid_size.x * map->grid_size.y - 1; while (i >= 0) { if (map->tiles[i] == COLLECTIBLE) return (0); i--; } ft_printf("\nFound no collectibles\n"); return (1); }