Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 String Manipulation 2
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jakey140




PostPosted: Thu Dec 14, 2006 9:43 pm   Post subject: String Manipulation 2

Hi again guys... This is regarding the same topic from before... I'm trying to figure out a program that will output any name into a diamond like formation. If you look at the code you can see what I'm basically trying to get at, however there are a few minor mistakes that I could use some help on...

[/code]

%This program will accept any user name (min 3 char, max 12), then output a cool design fully centred using there name.

var name : string

get name

locate (13 - length (name), 41 - length (name) div 2)
put name

locate (11 + length (name), 41 - length (name) div 2)
put name

for y : 1 .. length (name)
locate (12 - length (name) + y, 40 - length (name) div 2 - y)
put name (y) ..

locate (12 + length (name) - y, 40 - length (name) div 2 - y)
put name (y) ..

locate (13 - y, 38 + length (name) - y)
put name (y) ..

locate (9 + y, 38 + length (name) - y)
put name (y) ..

end for
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 1 Posts ]
Jump to:   


Style:  
Search: