I just noted this thread.
Years back I wrote a _very_basic_ "home world locator" for characters in teh Spinward Marches. I forget what disk I left it on and the system I used it on is long dead.
But it was written in PASCAL(stop laughing!!!)
It would
1) randomly choose two numbers between 1 and 4 inclusive to determine a subsector
2) Enter a subroutine and randomly choose a number between 1 and 8 inclusive to determine the column in the subsector
3) fall into a case statement based on the number from step 2 which would enter a subroutine that would generate a random number from 1 to the number of world's in the selected column in the selected subsector.
If there were no worlds in that subsector, it would re-run.
For example(and in a bit more detail),
The first selection would choose 1 to 4 and if it determined 4(the last column in the subsector),
A case would drop it into a second 1 to 4 generation who's case would choose between the subroutines Aramis, Rhylanor, Mora and TrinsVeil.
Once the 1-4 determined which subsector(say 3 - Mora) the Mora subroutine would first run a 1 - 8 random number and drop it into a case statement.
Here is where the real work was done because I tailored each of the eight possible outcomes to a random number based on that subsector's columns.
So if the 1 - 8 generator selected:
1: I could then get from worlds 1 to 3
2: I could then get from worlds 1 to 3
3: I could then get from worlds 1 to 2
4: I could then get from worlds 1 to 4
5: I could then get from worlds 1 to 3
6: I could then get from worlds 1 to 7
7: I could then get from worlds 1 to 2
8: I could then get from worlds 1 to 2
So if it chose 5 from the "pick 8" and then chose 2, it would then spit out the "address" of the system as 4352. All I would need do then is check the map for the subsector third down in the fourth column and then look for the second system down in the fifth column to see my homeworld is Rorise.
The logic is very simple but the difficulty is in tailoring the random generators led to by each of the case statements one you've selected the subsector. In the end, I was actually re-writing the program to spit out both the system name and the full UWP(with the PGR, trade classifications, etc...)
Marc