: say ( s -- ) me @ swap notify ; : main ( s -- ) .sstrip tolower "-h" 2 strncmp not if "Usage: localwho" say exit then 0 "" "" loc @ contents begin dup while dup player? if dup "D" flag? not me @ wizard? or if dup "U" flag? not over "@level" getpropstr atoi me @ "@level" getpropstr atoi <= or over awake? and if rot over name ", " strcat strcat -3 rotate else swap over name ", " strcat strcat swap then 4 rotate 1 + -4 rotate then then next loop pop "There are %n entities in the room." 4 pick 1 = if "entity" "entities" subst "is" "are" subst then 4 rotate intostr "%n" subst say "Awake: " 3 pick not if rot pop "There is no one awake here." strcat else rot dup strlen 2 - strcut pop strcat "You" me @ name subst "." strcat then say "Sleep: " over not if swap pop "There is no one asleep here." strcat else swap dup strlen 2 - strcut pop strcat "You" me @ name subst "." strcat then say ;