Author |
Message |
mitko1994
|
Posted: Mon May 16, 2011 4:29 pm Post subject: String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
What is the problem you are having?
i need to add the spaces to the string shown
Describe what you have tried to solve this problem
everything
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
% Hey, the string im suppose to do is as follows, notice the spaces in between that's what i need edited
% if you can please edit the code so it outputs these spaces and also can you please edit the error trap so that it traps if the string length is over 24
%can you pls also check if my locate formula would always center horizontally and vertically
%also can you briefly explain what each of these loops does i think i kind of understand what they do but not clearly
% i think first for loop determines number of times to be executed, second for loop is for...
%Thanks a lot
%e
%e c
%eci
%ec in
%ecina
%eci naJ
var name: string: ="Dimitr"
%get name
%loop
%if name(*) > name(24) then
%put"invalid input"
%delay(2000)
%cls
%get name
%else
%exit
%end if
%end loop
procedure PauseProgram
var key: char
put "Press any key to continue"
key:= getchar
end PauseProgram
for decreasing y: length(name ).. 1
for decreasing x: length(name )..y
locate((24- length(name )div 2-x ),(80- length(name ))div 2+x )
put name (x.. *)
put" "
end for
end for
|
Please specify what version of Turing you are using
<Answer Here>
4.1.1 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Raknarg
|
Posted: Mon May 16, 2011 4:52 pm Post subject: RE:String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
I think most people here would agree that we're not here to do the code for you, for future reference.
So what exactly are you trying to do? What's the task? |
|
|
|
|
|
mitko1994
|
Posted: Mon May 16, 2011 5:02 pm Post subject: Re: String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
e
e c
eci
ec in
ecina
eci naJ
thats my string"Janice" |
|
|
|
|
|
Raknarg
|
Posted: Mon May 16, 2011 5:18 pm Post subject: RE:String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
You still haven't explained your task. What exactly is this code supposed to accomplish? |
|
|
|
|
|
goroyoshi
|
Posted: Mon May 16, 2011 8:07 pm Post subject: RE:String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
he is trying to take a name and put it into that format that he showed |
|
|
|
|
|
Tony
|
Posted: Mon May 16, 2011 8:24 pm Post subject: RE:String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
I would guess that the OP's main problem is describing that particular format. Because if it does what I think it does, then translation English -> Code should be straight forward.
So I think the next step would be to wait for the OP to describe the specification of this format. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Raknarg
|
Posted: Tue May 17, 2011 12:58 pm Post subject: RE:String Manipulation NEED HEEEEELP FAST !!!!! |
|
|
ah... that seems really random :/ |
|
|
|
|
|
|