Up to Main Index                           Up to Journal for January, 2019

                    JOURNAL FOR MONDAY 21ST JANUARY, 2019
______________________________________________________________________________

SUBJECT: There has to be limits
   DATE: Mon 21 Jan 21:04:50 GMT 2019

Based on positive feedback I’ve received, I’ve been making some more changes
to the item search and matching that was recently introduced with the WHICH
command[1]. There are also some bug fixes included in the latest update.

All examples given will be based on this description:


  Fireplace
  You are in the corner of the common room in the dragon's breath tavern. A
  fire burns merrily in an ornate fireplace, giving comfort to weary
  travellers. The fire causes shadows to flicker and dance around the room,
  changing darkness to light and back again. To the south the common room
  continues and east the common room leads to the tavern entrance.

  You see a large red ball here.
  You see a small green ball here.
  You see a large green ball here.
  You see a small bag here.
  You see a small red ball here.
  You see a small sack here.
  You see a curious brass lattice here.
  You see an iron bound chest here.

  You can see exits east, southeast and south.
  >


First of all a simple ‘WHICH BALL’ will get the first ball only and not all of
the balls. However, you can now use ALL as a qualifier. For example:


  >WHICH BALL
  You look around.
  You see a large red ball here.
  >WHICH ALL BALL
  You see a large red ball here.
  You see a small green ball here.
  You see a large green ball here.
  You see a small red ball here.
  >WHICH GREEN BALL
  You see a small green ball here.
  >WHICH ALL GREEN BALL
  You see a small green ball here.
  You see a large green ball here.


It seems that ‘WHICH BALL’ referring to all balls was not well received as it
was unintuitive and/or unexpected. On the other hand having a ‘WHICH ALL BALL’
was deemed to be a much better solution.

I wasn’t sure if I was going to add ranges or not, but here they are! Ranges,
like limits and specific instances are special qualifiers of the form n-N.
Where n is the lower limit and N is the higher limit. For example:


  >WHICH 2-3 BALL
  You see a small green ball here.
  You see a large green ball here.
  >WHICH 2-4 BALL
  You see a small green ball here.
  You see a large green ball here.
  You see a small red ball here.


Given ‘WHICH ALL BALL’ lists four balls, ‘WHICH 2-3 BALL’ matches only the 2nd
to 3rd balls, while ‘WHICH 2-4 BALL’ matches the 2nd to 4th balls.

A bug was found when merging sub-groups together. If you had something like
‘WHICH ALL BALL GREEN BALL’ the two groups of matches were not merged together
properly. This has been fixed.

When merging sub-groups the ordering was incorrect. For example ‘WHICH BAG
BALL SACK’ would return:


  You see a small bag here.
  You see a small red ball here.
  You see a large green ball here.
  You see a small green ball here.
  You see a large red ball here.
  You see a small sack here.


Instead of:


  You see a small bag here.
  You see a large red ball here.
  You see a small green ball here.
  You see a large green ball here.
  You see a small red ball here.
  You see a small sack here.


That is, the ordering of the balls was reversed. This has now been fixed.

All changes have been pushed out to the public dev branch for people to play
with some more.

--
Diddymus

  [1] ../../2019/1/20.html


  Up to Main Index                           Up to Journal for January, 2019