Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # "F" = Floor, "W" = Wall
- dungeon_map = [
- ["W", "W", "W", "W", "W"],
- ["W", "F", "F", "W", "W"],
- ["W", "W", "F", "F", "W"],
- ["W", "F", "F", "W", "W"],
- ["W", "W", "W", "W", "W"]
- ]
- player_x = 2
- player_y = 2
- def count_adjacent_floors(map_data, x, y):
- # TODO: Count how many floor tiles (F) are directly adjacent (up/down/left/right)
- return 0 # Placeholder
- print(count_adjacent_floors(dungeon_map, player_x, player_y))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement