title: Randomly placing an element in an array
body: <p>For a game I have an ascii map, it is stored in an array. # represents a wall and . represents walkable space. At the start of the game the player needs to be randomly placed on a square that isn't a #, what is the most efficient algorithm for doing this? I could just randomly place the player and then do it again if the space isn't legal but I'm sure there is a more efficient way of doing this.</p>