Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / [LOCKED] a simple text program

Years of Service
User Offline
Joined: 9th Feb 2010
Posted: 10th Feb 2010 03:16
here is a rely simple code only using text, string and some other simple commands

simple right?
Years of Service
User Offline
Joined: 12th Jun 2007
Posted: 14th Feb 2010 04:43 Edited at: 14th Feb 2010 04:50
Your code can be cleaned up just a tad. Once you set text attributes, you don't need to constantly reset them. Every loop, you're calling

set text to italic
set text font "times new roman"
set text size 32

when you don't need to, that's just eating up processing cycles. Move it outside of your main loop, and that'll help. By moving it outside, it makes the main loop run about 270 times faster. It doesn't really matter here, since you're pausing for a half of a second, but it's good practice in the future to try to optimize like this, when you need to squeeze out every ms you can.

How about next you try to take the names of many people, and place them on the screen in a random order in random positions?
Retired Moderator
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 13th Mar 2010 00:25
Now your thread is locked, it might prompt you to read the sticky in big letters at the top of this board entitled 'WHY MY THREAD WAS LOCKED'.

It even has asterisks to go with the capital letters to tempt people to read it before posting - the only real option we have since TGC didn't give us the option of flashing lights and a dirty great klaxon!

Sorry for the rant, but you have no idea how many hours of our lives can be wasted repeating this over and over again when you said you would read stickies before posting when you signed up for the forum... THEN DIDN'T!!!


Login to post a reply

Server time is: 2023-10-01 05:35:10
Your offset time is: 2023-10-01 05:35:10