32 lines
608 B
Plaintext
32 lines
608 B
Plaintext
#TEXT="rosetta code phrase reversal"
|
|
|
|
If OpenConsole("rosetta code phrase reversal")
|
|
Define idx.i=1, txt.s=""
|
|
|
|
Print(~"Original:\t\t")
|
|
PrintN(#TEXT)
|
|
|
|
Print(~"Reversed:\t\t")
|
|
PrintN(ReverseString(#TEXT))
|
|
|
|
Print(~"Reversed words:\t\t")
|
|
txt=StringField(#TEXT,idx," ")
|
|
While Len(txt)
|
|
Print(ReverseString(txt)+" ")
|
|
idx+1
|
|
txt=StringField(#TEXT,idx," ")
|
|
Wend
|
|
PrintN("")
|
|
|
|
Print(~"Reversed order:\t\t")
|
|
idx-1
|
|
txt=StringField(#TEXT,idx," ")
|
|
While Len(txt)
|
|
Print(txt+" ")
|
|
If idx>1 : idx-1 : Else : Break : EndIf
|
|
txt=StringField(#TEXT,idx," ")
|
|
Wend
|
|
|
|
Input()
|
|
EndIf
|