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

Username:   Password: 
 RegisterRegister   
 Need help with colouring plz
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
supersaiyan




PostPosted: Sun Oct 08, 2006 11:38 am   Post subject: Need help with colouring plz

I have Turing 4.0.5--Windows Version
really simple question
i am a beginer, started using turing yesterday
here's the question about colouring
i.e when i use this


colourback (10)
put "HI"
when i run it, background for whole line is green like this
Posted Image, might have been reduced in size. Click Image to view fullscreen.
i just want the background for only HI, now the whole line

plz tell me how to do it


Thanks
[/quote]
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Sun Oct 08, 2006 12:31 pm   Post subject: (No subject)

well, from what i remember the only you may be able to do that is to actually draw a box behind the words, because what colorback does is redesignate what the background color of your screen is (in your case green), and when you put something, it clears that line then puts the output, hence the green line.

To do this you may want to look into default sizes of font (check in your options menu, it should be in there) and create a procedure to have just the background behind your letters be colored Very Happy

If you want just the actual writing to be colored, then use the color () procedure, which changes the color of your output (when using put) to the specified color
Tony




PostPosted: Sun Oct 08, 2006 12:36 pm   Post subject: (No subject)

put includes a new-line character by default, and that clears the rest of the line, colouring it in the process.

a little hack that I would imagine would work is:
code:

colourback(green)
put "Hi"..
colourback(white)
put ""

the .. on the 2nd line forces the output to continue on the same line. This is where you switch back to the other colour, and fill the rest of the line with that.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
NikG




PostPosted: Sun Oct 08, 2006 5:36 pm   Post subject: (No subject)

Tony wrote:
a little hack that I would imagine would work is:
code:

colourback(green)
put "Hi"..
colourback(white)
put ""
Weirdly enough, if you remove the last 2 lines (so you're left only with colourback(green) and put "Hi"..), this works too.

For any input after that, you could then use locate.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: