[TIB] Re: Character Substitution?


[Prev][Next][Index][Thread]

[TIB] Re: Character Substitution?




"Missing (" and it points to the line "Goto End"

Thanks for your help! Also, how would I go about "expanding" it for 
encompass more letters? Thanks again!

TM

At 08:38 PM 5/3/2001 -0500, you wrote:

>On Thu, 3 May 2001, ffolkes wrote:
>
> >
> > Hello-
> >
> > I'd like to make a program to substitute characters from a string, i.e.:
> >
> > g = t
> > o = r
> > a = b
> > t = v
> > s = n
> >
> > String: "goats"
> > Output of Program: "trbvn"
> >
> > *Roughly*, how would I go about this? I am familiar to an extent with
> > TI-BASIC. Thanks.
> >
> > TM
> >
> >
> >
>
>Hi,
>
>here's a program for a ti-92 to do that
>Just enter the string and hit esc
>
>
>
>""->fstring
>newMat(26,2)->mat
>"g"->mat[1,1]
>"t"->mat[1,2]   g = t
>"o"->mat[2,1]
>"r"->mat[2,2]   o = r
>...
>Lbl begin
>While k=0
>getKey()->k
>EndWhile
>If k = 264      Esc was hit
>Disp String
>Goto end
>EndIf
>char(k)->c      Turn Value from getkey to a character
>0->k
>0->done
>0->i
>While done=0            Search matrix till it finds the correct character
>If c=mat[i,1] Then
>String&mat[i,2]->String
>1->done
>EndIf
>i+1->i
>EndWhile
>Goto begin
>Lbl end




Follow-Ups: References: