Here's the source code for a 68k Basic implementation that I wrote this morning. It supports the core of the language and the Merthing @ Kerm extension. I think the Nikky extension would be impossible to do with the way I wrote it, and I'm not sure if there's a better way to write it.
It works, but it's a little slow. Maybe a 68k C implementation (which I'll do as well, perhaps) would run better.
It was generated by
DaisukeEdit, but after doing that I replaced the "->" character with the string "->", so you won't be able to just plug it back into there. (I did the same with "!=").
Code: merthese(cmds)
Prgm
Local i,j,chr,out,letters,rnd,nexth,accum
{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}->letters
Define nexth(cmds)=Func
Local i,chr
""->chr
0->i
If inString(cmds,"h")=0 Then
Return cmds
EndIf
While chr!="h"
i+1->i
mid(cmds,i,1)->chr
EndWhile
Return mid(cmds,i+1)
EndFunc
" "->chr
""->out
0->accum
0->i
ClrIO
While chr!=""
i+1->i
mid(cmds,i,1)->chr
If chr="m" Then
If rand()<.5 Then
out&"merth"->out
Else
out&string(accum)->out
EndIf
ElseIf chr="e" Then
If rand()<.5 Then
out&char(13)->out
Else
accum+1->accum
EndIf
ElseIf chr="r" Then
If rand()<.5 Then
out&" "->out
Else
0->accum
EndIf
ElseIf chr="t" Then
rand(13)->rnd
For j,0,rnd
out&letters[rand(26)]->out
EndFor
ElseIf chr="h" Then
nexth(mid(cmds,i+1))->cmds
0->i
ElseIf chr="k" Then
out&char(accum)->out
EndIf
EndWhile
0->i
" "->chr
While chr!=""
i+1->i
mid(out,i,1)->chr
If chr=char(13) Then
Disp mid(out,1,i-1)
mid(out,i+1)->out
0->i
EndIf
EndWhile
Disp out
EndPrgm