Looking for a way to toggle whether certain elements from a list are chooseable

Hello, noob here!

I am making a tile randomizer for the interior of a house. Currently I have it set to place an initial tile in a 4x4 grid, then randomly select a door in that room. It then checks the grid space that the door leads to to see if it is at the edge of the house and whether it is next to any other rooms with either a wall facing it or a door. It saves all of this information. I want to have a list of all possible tiles that can be placed in that space and do a systematic check where if for example, it is a bottom left space, the tiles where the bottom and left have a door are removed from the list, and so on for each wall and then randomly select a tile from the remainder to be placed in that grid space. Then of course, in order to continuously do this until the house is filled, the list would have to be repopulated.

Are there any flow controls or functions that can allow me to toggle whether elements from a list are unselectable after a check?

Thank you so much!

You could start with an empty array and as you determine that tiles are potentially okay for your spot, append them to the array. Then choose a random item out of the array. Then clear the array and start with it empty as you check the next spot.

Can you elaborate on this? I’m not really sure what you’re trying to say. Currently I find a door that does not lead to a room yet, and figure out where that room needs walls and doors to fit the rest of the map. What I need is to pick a correct room from the list based on what the room needs without brute forcing it with branch functions.