
-----------------------------------
Cheburashka
Thu May 07, 2009 6:25 pm

strings help
-----------------------------------
i need to find a way to flip the variable so for example if the person enters a word lets say "myname"   i need it to convert to "emanym", so i can work with it later.
if anyone knows a possible code to do that please help

or

you know how you can get to display variables letters such as name(1..3)
how is it possible to make it (3..1)??????????

-----------------------------------
Tony
Thu May 07, 2009 6:54 pm

RE:strings help
-----------------------------------
well you can start with name(1), name(2), name(3), and then place them in the correct order.

-----------------------------------
Cheburashka
Thu May 07, 2009 7:00 pm

Re: strings help
-----------------------------------
i get what you mean i tried it before, but my teacher said there is a way to simplify it, so i think its either reverse the name and mak i go (1..3),, or somehow chafigure out the (3..1) way

-----------------------------------
andrew.
Thu May 07, 2009 7:10 pm

RE:strings help
-----------------------------------
Try using for loops to go through each letter forwards and then backwards with another for loop.

-----------------------------------
Dusk Eagle
Thu May 07, 2009 7:38 pm

Re: strings help
-----------------------------------
I don't see why you need to go forward through the loop at all. Do you know how to go backward through a for loop? If so this task should be pretty simple. (If you don't, look in the Turing documentation of 'for' loops).

-----------------------------------
Cheburashka
Thu May 07, 2009 7:44 pm

Re: strings help
-----------------------------------
I don't see why you need to go forward through the loop at all. Do you know how to go backward through a for loop? If so this task should be pretty simple. (If you don't, look in the Turing documentation of 'for' loops).

yeah its 
for decreasing

what i've tried is

for decreasing x : len .. 1
    put name (x)

end for 

it works but its in the upward direction like

a
m
a
n

when i press locate it only gives me the first letter of the name

if possible can you please tell me what i need to fix about it

-----------------------------------
Cheburashka
Thu May 07, 2009 7:47 pm

Re: strings help
-----------------------------------
I don't see why you need to go forward through the loop at all. Do you know how to go backward through a for loop? If so this task should be pretty simple. (If you don't, look in the Turing documentation of 'for' loops).

actally nvm i think i already got it
thanks for help though

-----------------------------------
Kharybdis
Thu May 07, 2009 7:55 pm

Re: strings help
-----------------------------------
I don't see why you need to go forward through the loop at all. Do you know how to go backward through a for loop? If so this task should be pretty simple. (If you don't, look in the Turing documentation of 'for' loops).

yeah its 
for decreasing

what i've tried is

for decreasing x : len .. 1
    put name (x)

end for 

it works but its in the upward direction like

a
m
a
n

when i press locate it only gives me the first letter of the name

if possible can you please tell me what i need to fix about it


var sentence := "This is a sentence!"
for decreasing i : length(sentence) .. 1
put sentence(i) ..
end for
 
