Passages 0 ▲ ronjeffries.com 13 hours ago · 11 min read2181 words · Tech · hide · 0 comments Hello, loves! I have a somewhat complex idea about passages, but a simpler scheme might work. Let’s find out. Anticlimax: I stop just before the thrilling conclusion. Last night, in between time-wasting activities, I did a little thinking about passages. The main concern is to randomly choose, on each border between rooms, one passage. However, we’d like it to tend to choose areas in the border that are relatively complex, rather than in the straight bits. So that got me thinking about weighted random choice, for which Python has support, so I sketched out a series of data structures that I thought I could get, leading to this scheme: Make a list of all the cells on both sides of the border. When a cell is found to have a neighbor in the other room, add both to the list. This will result in some cells occurring 1, 2, or 3 times. Using Python’s Counter, make a dictionary from cell to the count of times it occurs. Associate the desired weight with each possible count, perhaps 1:1, 2:10,… No comments yet. Log in to reply on the Fediverse. Comments will appear here.