One day, I witnessed the usual trout slappings of IRC, perpetrated by the usual mIRC users. It was the usual thing:
* SomeLamer slaps Victim around a bit with a large trout
This sort of message is typically generated by mIRC's /SLAP command. It's an awfully trivial alias, intended primarily to teach users how to make aliases. Still, some people find it entertaining.
As I watched the water warriors fight it out, I thought to myself, Wouldn't it be cool if I one-upped these guys, and made the
most sophisticated /SLAP ever?
This program,
Randtrout, is the distant descendant of my efforts to realize
this goal.
The first version of Randtrout, 0.1, was written in C++ and was very primitive compared to the current version. I hacked on and improved it for a while, eventually raising its version number to 0.3.2. To give you an idea of the level of sophistication of this program:
The non-standard attack types are something to the effect of:* Attacker slaps Victim around a bit with a large trout
Or even:* Attacker was imprisoned for 30 days for aggravated assault of Victim with a large trout
* Attacker decorates the opposite wall with blood and guts formerly belonging to Victim with a large trout
Though primitive compared to this version, Randtrout 2 was a radical step forward in Randtrout technology (forgive my choice of words here). Among its major highlights:
verbs
. Something like slaps
or brutally pummels
.
around a bit
or all over the place
.
trout
being the traditional example.
large
.
Messages could reference any of the other elements, along with a few
special things, like automatic articles, with
printf
-style % codes. %n was the code for
an automatic article, for instance.
In Randtrout 3, these sequences have been superseded by the XML tags in the configuration file.
Swing
,
Randtrout 2 sported a graphical configuration tool. Though by
no means easy to use, this tool was much more elegant than editing
source files and recompiling.
Messages, as defined above, could now be given a probability that they would be selected. This way, a certain message could be more rare than the others.
In case you're wondering, the <member>
element in
the Randtrout 3 configuration file provides this
functionality, through the chance
attribute.
Some time after making Randtrout 2, I became dissatisfied with its inelegance and inflexibility, and so I stopped using it. Eventually, I decided that I should write another Randtrout, that would overcome Randtrout 2's limitations. Once I got to thinking about it, I quickly realized that the flat configuration format used by Randtrout 2 would have to go; references needed to be more flexible, and there needed to be more elements, which meant multiple-character elements, which meant the % code mechanism used by Randtrout 2 would have to be retired.
When I considered how to format the configuration file to allow for multiple-character elements, it became obvious that XML was probably a good choice. The JAXP API was the first thing I looked at for an XML processor, and, as you can probably tell, I was not overly impressed with the alternatives. I began to learn JAXP, and the rest is history...