Up to Main Index                            Up to Journal for August, 2019

                    JOURNAL FOR SATURDAY 24TH AUGUST, 2019
______________________________________________________________________________

SUBJECT: PUT command put to bed
   DATE: Sat 24 Aug 17:11:58 BST 2019

I now have a PUT command, using the matcher, that I’m mostly happy with. I’ve
moved the container matching and validation to a new put.findContainer method
and item validation to a new put.findItem. As a result the guts of the PUT
command in put.process is much simpler and cleaner :)

The only compromise I made was in the handling of multiple containers. If you
try to PUT things into multiple containers:


  >PUT BALL ALL BOX
  You can only put things into one container at a time.
  >


A bit of a cop-out for now, but something that can be changed later on. It’s
easier to add functionality than to remove it, someone else may be relying on
it. Which is another reason why I am spending so much time on this to get it
right — I have to support it moving forwards.

The performance is not optimal, attr.FindXXX results are not reused between
the methods, so some finds are duplicated. Some rough performance figures
using a quad core i5-2400 desktop (Debian) and a Raspberry Pi 3B (Raspbian),
both built with Go 1.12.9:


                    Command              i5-2400  RPI3B
                    -------------------  -------  ------
                    PUT BALL SACK          200µs   580µs
                    PUT ALL BALL SACK      300µs  1140µs
                    SOUTH (empty room)     165µs   400µs
                    WEST  (busy room)      250µs   890µs
                    LOOK                   200µs   755µs

                    1µs (microsecond) = 0.000001 second


Quite respectable with room for improvement. Now to write tests for the
existing TAKE command, reimplement take to use the matcher, then write more
tests to cover the matcher functionality. Monday is a bank holiday for me and
I plan on spending it working on WolfMUD…

Updated PUT command and tests are now on the public dev branch. Any comments
or feedback greatly appreciated: diddymus@wolfmud.org

--
Diddymus


  Up to Main Index                            Up to Journal for August, 2019