Switch, Case and wild-cards?

Richmond richmondmathewson at gmail.com
Sat Dec 29 04:03:18 CST 2012

On 12/29/2012 04:40 AM, Mark Wieder wrote:
> Richmond-
> Friday, December 28, 2012, 2:24:28 PM, you wrote:
>> 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 don't think that's going to work. Or there's information missing or
> something. By those rules, the first Z moves to after the a. Then the
> X no longer follows the a. Is that what's desired? Are rules 1,2, and
> 3 in order of precendence? Are these the *only* three rules? Rule
> number 3 needs more fleshing out before anything can be done with it.
> If the second Z moves after the v in vfgh and the second X moves
> before the h in vfgh, does that break up a possible decryption of vfgh
> or does it create a new fg phrase to be decrypted? I really hate to go
> in this direction, but my guess is that you need more rules.

Right . . .

starting with ZaX; we should get something like this: XaZ, where, 
because if rule #3 'a' expands from a single char
to a string of unicode chars: I have a feeling that should happen after 
the reordering of Z and X.

in the case of Zv we should end up with vZ, where, again, 'v' could 
expand to a string of unicode chars.

in the case if hX we should end up with Xh, and, again . . .

So; as far as I see things there need to be 2 distinct operations:

1. to move Z and X.

2. to (possibly) expand what are represented by lower-case letters into 
unicode strings.

More information about the use-livecode mailing list