Computer Science Canada The Customizer |
Author: | Remm [ Mon May 08, 2006 6:55 pm ] | ||
Post subject: | The Customizer | ||
Yeah. This is my first program that wasnt assigned by a teacher ( the class stuffs is just drooling with simplicity ) Any feedback on it is welcome. Oh, and for some reason, it works fine on my school computer, yet at home the object will move super fast from one side of screen to other, and it pumps comp usage up to 100%. if anyone knows why it does so, (maybe the multiple proceedures running) please tell me. Thanks, and have fun. controls: insert - colour back # up delete - colour back # down home - object colour # up end - object colour # down page down - change object arrows - move object
|
Author: | HellblazerX [ Mon May 08, 2006 7:17 pm ] | ||
Post subject: | |||
Don't use processes. You don't need them, and they make life a pain in the read end. Also, the reason why it runs really fast on your home computer is because your school computer is really slow. You should use the delay function to stop your program temporarily for a period of time. The way you would use it is like this:
Not sure about that 100% CPU thing. Probably because of the processes. |
Author: | Remm [ Mon May 08, 2006 7:25 pm ] |
Post subject: | |
Yeah. im kinda a processd fiend. But they work so well! -.- I added in delays and it works much better... with delays at school computer though, its just scary. |
Author: | HellblazerX [ Mon May 08, 2006 7:33 pm ] |
Post subject: | |
Ya, school computers can be very scary. Last year when me and my partner made our FP, we had made it on our computers, and we can timed the delays and stuff according to our computers, but when we brought it to school,......wow what mess. We used to have computers that if you typed one letter, it would take 5 minutes for it to show up on the screen, and I'm not even joking with you. |
Author: | ohgeez_ [ Mon May 08, 2006 8:07 pm ] |
Post subject: | |
im not too sure about this.. but i believe u can use some arrays instead of all those variables. It doesnt really save any lines but it would seem more neat and it would be easier to manipulate later. Also. as the other guy said, avoid forks and processes. There a pain to try and control. if its possible at all. otherwise. its quite interesting |
Author: | upthescale [ Mon May 08, 2006 9:19 pm ] | ||||
Post subject: | |||||
HellblazerX wrote: it would take 5 minutes for it to show up on the screen, and I'm not even joking with you.
yea man, at school if i want an oval to move instead of doing
if would have to do:
i had to re-draw the oval white because cls would lag my compyuer soooo frigging <b>MUCH</b> |
Author: | [Gandalf] [ Mon May 08, 2006 9:20 pm ] |
Post subject: | |
Yes, please avoid processes for the good of us all. Quote: Ya, school computers can be very scary. Last year when me and my partner made our FP, we had made it on our computers, and we can timed the delays and stuff according to our computers, but when we brought it to school,......wow what mess. We used to have computers that if you typed one letter, it would take 5 minutes for it to show up on the screen, and I'm not even joking with you.
This is why you use Time.DelaySinceLast() instead of Time.Delay() aka delay(). It ensures approximately equal run time on computers of all speeds. Quote: Not sure about that 100% CPU thing. Probably because of the processes.
Processes are bad, but they are not the cause of this. Turing programs always take up 100% processing power as long as they are running. For more information on processes, you may want to check out our two tutorials on them: Part 1. Part 2. But better yet, why don't you check out how to organize your program properly into procedures and functions? |
Author: | Remm [ Tue May 09, 2006 7:02 am ] |
Post subject: | |
Uhh... yeah.... about proceedures... how exactly are they different from process? it doesnt loop unless you press a key? guess its time for me to look over that Turing Walkthrough thing. Oh, and my school computers must be horrible, because all process-massing programs seem to work perfectly without delays. As did this one. I'll try to let up on the process massing, seeing as how its basically random output Remm |
Author: | [Gandalf] [ Tue May 09, 2006 3:27 pm ] |
Post subject: | |
Processes are concurrent, procedures are sequential. Calling a procedure inside your code is just like copy and pasting the code inside it to that point inside the program. Just more organized and allowing things like arguments, recursion, etc. |