Max Word Length

A function to get the length of the longest word in a list.

Author: Jules@M*U*S*H
Category: Functions
Commands: @create, @describe, @lock.
Compatibility: PennMUSH.

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Max Word Length

@create Max Word Length
@lock Max Word Length==me
@describe Max Word Length=think u\([num(me)]/fun`max_word_len,a bb ccc)%rthink u\([num(me)]/fun`max_word_len,apple|banana|kiwi,|)%r%r[ulocal(FUN`MAX_WORD_LEN`DOC)]
&FUN`MAX_WORD_LEN Max Word Length=letq(d,strfirstof(%1,%b),lmath(max,vsub(lpos(%0%qd,%qd),lpos(%qd%0,%qd))))
&FUN`MAX_WORD_LEN`CC Max Word Length=list:*:delimiter r:int:length_of_longest_word func
&FUN`MAX_WORD_LEN`DOC Max Word Length=O(1) function (6 calls) to get the length of the longest word in a list. Takes one to two arguments. LIST is a DELIMITER separated list of items. The delimiter defaults to space if not given or if null.

look Max Word Length