Paul_one may have to give you better specifics about this but I'm going to copy some code out of my game and show you. The first segment was what was posted at the beginning of the file. It sets specific points of interests throughout the grid; in other words, these are the non-repeating room coordinates...
startscript {
set string <oasis[1]; 5,2>
set string <oasis[2]; 9,3>
set string <oasis[3]; 7,0>
set string <oasis[4]; 7,-1>
set string <oasis[5]; 6,3>
set string <oasis[6]; 10,6>
set string <oasis[7]; 0,3>
set string <oasis[8]; 0,4>
set string <oasis[9]; 0,5>
set string <oasis[10]; 0,6>
set string <oasis_room[1]; oasis1>
set string <oasis_room[2]; oasis2>
set string <oasis_room[3]; oasis3>
set string <oasis_room[4]; stone temple>
set string <oasis_room[5]; desert skeleton>
set string <oasis_room[6]; tents>
set string <oasis_room[7]; death1>
set string <oasis_room[8]; death2>
set string <oasis_room[9]; death3>
set string <oasis_room[10]; death4>
if ( $loadmethod$ = normal ) then do <start>
}
properties <desert_x=0; desert_y=0>
Now here's some code from the middle part of the game. It defines the desert rooms including the oasis rooms.
define room <start>
alias <end of the forest>
prefix <the>
look <At the edge of the forest, the desert sands strangle what remaining grass tries to grow. Further west is nothing but desert sand as far as you can see.>
south do <desert_exit(S)>
east {
goto <northeastern clearing>
}
west do <desert_exit(W)>
description {
msg <You are at the |b|clend of the forest|xb|cb.|n>
msg <#quest.lookdesc#>
}
end define
define room <desert>
prefix <the>
look <Endless sand in all directions.>
north {
if ( #edgedetect[2]# = FALSE ) then msg <The face of a cliff blocks any further passage north.> else do <desert_exit(N)>
}
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
script {
set numeric <ED_north1; #game:desert_y# - 1>
set numeric <ED_east1; #game:desert_x# - 1>
set string <edgedetect[1]; $desertroom(%ED_east1%; #game:desert_y#)$>
set string <edgedetect[2]; $desertroom(#game:desert_x#; %ED_north1%)$>
}
end define
define room <oasis1>
alias <oasis>
prefix <the>
look <You've reached the oasis. What a pleasant relief to find among the desert sands.>
north do <desert_exit(N)>
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
description {
msg <You are at the |b|cloasis|xb|cb.|n>
msg <#quest.lookdesc#>
}
prefix <the>
article <it>
gender <it>
end define
end define
define room <oasis2>
alias <oasis>
prefix <the>
look <You've reached the oasis. What a pleasant relief to find among the desert sands.>
north do <desert_exit(N)>
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
description {
msg <You are at the |b|cloasis|xb|cb.|n>
msg <#quest.lookdesc#>
}
end define
end define
define room <oasis3>
alias <oasis>
prefix <the>
look <You stand before a huge opening in the cliff to the north. You can see a huge stone temple carved right into the side of the cliff.|nA small oasis sits near a small boulder.>
north do <desert_exit(N)>
south do <desert_exit(S)>
east do <desert_exit(E)>
west do <desert_exit(W)>
end define
This is the crazy formula:
define function <desertroom>
set string <returning; 1>
set numeric <upper; $ubound(oasis)$>
if ( $numberparameters$ > 0 ) then {
if ( $parameter(1)$ > 0 ) and ( $parameter(2)$ < 0 ) then {
set string <hypoth; $parameter(1)$,$parameter(2)$ >
set string <returning; FALSE>
for <i; 1; %upper%> {
if ( #hypoth# = #oasis[i]# ) then set string <returning; TRUE>
}
}
else set string <returning; TRUE>
}
else {
for <i; 1; %upper%> {
set string <dest; #game:desert_x#,#game:desert_y#>
if ( #dest# = #oasis[i]# ) then set string <returning; #oasis_room[i]#>
}
if ( #returning# = 1 ) then {
if ( #game:desert_x# = 0 ) and ( #game:desert_y# = 0 ) then {
set string <returning; start>
property <game; desert_x=0; desert_y=0>
}
else {
if ( #returning# = 1 ) then {
if ( #game:desert_x# = 0 ) and ( #game:desert_y# = 1 ) then {
set string <returning; start2>
property <game; desert_x=0; desert_y=1>
}
else {
if ( #returning# = 1 ) then {
if ( #game:desert_x# = 0 ) and ( #game:desert_y# = 2 ) then {
set string <returning; start3>
property <game; desert_x=0; desert_y=2>
}
else {
set string <returning; desert>
}
}
}
}
}
}
}
return <#returning#>
end define