Switch, Case and wild-cards?

Richmond richmondmathewson at gmail.com
Fri Dec 28 17:24:28 EST 2012


Hey, happy campers; you may think my 1420 case statements are a bit extreme;
and when you refelct that variants on them are reduplicated across some 500
objects my phrase about "seeing purple bananas" may seem more reasonable :)

HOWEVER, right now I have a problem that has been stumping me for a bit 
and I don't really quite know why.

It goes like this:

I have a string of characters in a language that go something like this:

ZaXbbdsfZvfghXaasn

now I have to "translate" those into a different type of representation; and
the 3 "rubs" are these:

1. everytime I encounter a Z it must be moved after the next symbol's 
representation in the translation,

2. everytime I encounter an X it must be moved before the preceding 
symbol's representation in the translation,

3. some of the symbols represented in the original string are 
represented in translation by a single symbol,
     some by double symbols, and a few by triple symbols.

I started by nipping off the first char in the starting string . . . and 
have spent a long and fruitless day.

I would be extremely grateful with something that I feel is probably 
quite easy if I could just get my brains unknotted.

Richmond.




More information about the use-livecode mailing list