Hi2All

submitted to the BotBot
by
Mark Donovan

Here's Mark's own description of hi2all:
*X


Date: Sat, 19 Apr 1997 10:29:12 -0700
From: Mark Donovan

The "bulkhi" script and its cousin "bulkhi2" have some problems with English grammar. The most easily reproduced problem happens in room full of guests or in a room with only one other member. Other pathological conditions, although less easily tested cases, occur if WHOME is one of the last two(?) names in a room.
The common problem results in greetings like "Hi and Assorted Guests" and "Hello and Member 101". This is both confusing and it looks dumb -- or laughable in the case of "Hi and Low". Although most native English speakers recognize "Hoy" as some type of greeting (few realize "Hoy, Hoy!" was Alexander Bell's preferred telephone greeting), non-English speakers are often confused when they read their nickname in greetings like "Yo and Roman Lover".
The problem is trying to decide when to add "and" into the greeting. The "bulkhi" scripts do it by counting the number of names they've seen. This method is broken when all the names are guests or there's only one other user. In these cases, "and" is not needed. A similar problem occurs if WHOME is one of the last two users on the list. This throws the count off and breaks the counting scheme.
I first tried to fix bulkhi by adding logic to handle WHOME and to drop the extra "and" for the all guests case. Soon, however, the script became overly complicated and obtuse. Longing for simple recursion, I opted for a two-pass approach. My solution makes a list of the folks in a room, then adds punctuation and the conjunction in a second pass through the list. This is a rewrite of the method so I call it "hi2all" but you're welcome to release it as a replacement for "bulkhi".
Here are test results. Starfire is the nickname doing the testing. When a user types "hi2all" when he's alone in a room, "hi2all" replies "Hi, yourself!"

Yo, seb and assorted Guests

There are 5 users in Red Room:
  Guest 454 is at (197,196)
  seb is at (81,286)
  Guest 912 is at (134,296)
  Guest 980 is at (271,190)
  Starfire is at (490,314) 
***
Yo, assorted Guests

There are 3 users in The Study:
  Guest 185 is at (327,154)
  Starfire is at (306,149)
  Guest 84 is at (397,236)
***
Hey, D

There are 2 users in The Study:
  Starfire is at (103,332)
  D is at (365,232)
***
Hey, yourself!

There are 1 users in Palace Gate:
  Starfire is at (264,120)
***
Hey, Huw,  @ayla@, nori, {Lisa-lovely juliet}, VinnyF, Member 432,
~Angel ~+ , PRINCESS TRELAINA, nightrider, Ms. Mick and assorted Guests

There are 15 users in Palace Gate:
  Guest 430 is at (332,52)
  Huw is at (447,336)
  ! @ayla@ is at (27,192)
  nori is at (22,313)
  {Lisa-lovely juliet} is at (460,246)
  VinnyF is at (152,339)
  Member 432 is at (113,22)
  ~Angel ~+ ) is at (332,317)
  Guest 479 is at (75,234)
  PRINCESS TRELAINA) is at (463,64)
  nightrider) is at (256,41)
  Guest 486 is at (341,151)
  Starfire is at (243,351)
  Guest 487 is at (289,362)
  Ms. Mick is at (61,349)
Mark Donovan
donovan-m@worldnet.att.net
Phoenix, AZ