Computer Science Canada shortening code: loading bar |
Author: | iii [ Sun Jan 10, 2010 7:18 pm ] | ||
Post subject: | shortening code: loading bar | ||
What is it you are trying to achieve? Making lines that displays like a loading bar. What is the problem you are having? I believe that my code is simply too long and complicated. I want to know if there's any way to shorten the code. Describe what you have tried to solve this problem I read in the forum that loading bars use for counters. I tried that and ended up getting mutiple errors. I don't really get how counters work in a loading bar though. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using 4.1.1 |
Author: | Euphoracle [ Sun Jan 10, 2010 7:23 pm ] |
Post subject: | RE:shortening code: loading bar |
Have a quick read, good sir: http://compsci.ca/blog/now-loading-loading-bar-anti-pattern/ |
Author: | iii [ Sun Jan 10, 2010 7:40 pm ] | ||
Post subject: | Re: shortening code: loading bar | ||
Thank you for the link but can you please explain it? I'm afraid I don't quite get what 'sleep' stands for and why the counter is used. |
Author: | syntax_error [ Sun Jan 10, 2010 9:14 pm ] |
Post subject: | RE:shortening code: loading bar |
Have you learned for loops if not F2 or the turing walkthough is your friend! |
Author: | iii [ Sun Jan 10, 2010 9:31 pm ] |
Post subject: | Re: shortening code: loading bar |
Yeah, I have learnt it in school and already read the tutorial beforehand. ![]() |
Author: | TheGuardian001 [ Sun Jan 10, 2010 9:47 pm ] |
Post subject: | Re: shortening code: loading bar |
I think you may have missed the point of the article... |
Author: | iii [ Sun Jan 10, 2010 9:50 pm ] |
Post subject: | Re: shortening code: loading bar |
Mine is technically not a loading bar but is used for decoration; there are things for the user to do. I just think my code is too long. |
Author: | iii [ Sun Jan 10, 2010 9:58 pm ] |
Post subject: | Re: shortening code: loading bar |
I decided you guys are right. Argh, without a loading bar, life is so much easier. Thank you for your help and sorry I kinda wasted your time. |
Author: | Euphoracle [ Sun Jan 10, 2010 10:35 pm ] | ||
Post subject: | RE:shortening code: loading bar | ||
My post was trying to convey the point that unless you are loading something, you needn't use a loading bar. However, I will give a more general explanation of animating a line. I'm going to use a counter to repeat some code, its commented for explanation:
|
Author: | iii [ Sun Jan 10, 2010 11:17 pm ] |
Post subject: | Re: shortening code: loading bar |
Thank you so much! |