@prog globals.muf 1 9999 d 1 i : colwidth 15 ; : linelength 75 ; : roundup swap over + 1 - over / * ; : say me @ swap notify ; : merge over 4 pick + -4 rotate begin over 4 pick and while over 4 pick + 4 + pick 3 pick 5 + pick 3 pick exec if rot 1 - -3 rotate else over 4 + rotate 4 pick 4 pick + 4 + -1 * rotate swap 1 - swap then loop pop pop pop ; : sort (x1 ... xN N fn -- x1 ... xN N) (fn is x1 x2 -- i and returns true if the things are correctly ordered.) over 2 < if pop exit then over 2 / rot over - over 3 + -1 * rotate over over 3 + -1 * rotate swap sort dup 2 + pick over 4 + pick 3 pick + 4 + 3 pick 2 + roll sort dup 3 + rotate swap dup 3 + rotate merge ; : interested? trigger @ "_ignore-dark" prop-exists? not if dup "d" flag? if pop 0 exit then dup "dark" prop-exists? if pop 0 exit then then trigger @ "_require-prop" prop-exists? if trigger @ "_require-prop" getpropstr over swap prop-exists? not if pop 0 exit then then dup "secret" prop-exists? if pop 0 exit then pop 1 ; : maplist (x1 ... xN N fn -- y1 ... yN N) over 1 < if pop exit then 3 3 pick 2 + 1 for dup 1 + pick 3 pick exec swap put loop pop ; : get-name name dup ";" instr dup if 1 - strcut pop else pop then ; : exit-cmp stringcmp 0 > ; : saylines 1 begin over over intostr strcat trigger @ swap over over prop-exists? while getpropstr say 1 + loop pop pop pop pop ; : saynames dup not if pop exit then dup 1 = if pop say exit then 1 - 1 -1 for pop ( toadd sofar ) dup strlen dup 1 + colwidth roundup 4 pick strlen over + ( toadd sofar sflen sfru newlen ) linelength > if ( toadd sofar sflen sfru ) pop pop say else swap - 1 -1 for pop " " strcat loop swap strcat then loop dup if say else pop then ; : main me @ wizard? not if pop "" then dup not if pop trigger @ "_room" getpropstr atoi dbref else match then 0 swap exits begin dup while dup interested? if swap 1 + over then next loop pop ' get-name maplist ' exit-cmp sort "_pre-" saylines saynames "_post-" saylines ; . c q