Computer Science Canada Quick program, suggestions? |
Author: | TylerL [ Fri May 26, 2006 1:43 am ] | ||
Post subject: | Quick program, suggestions? | ||
It's late at night so I don't want to stay up and think about how I could fit trig into this, but paste that in Turing and run it, give me some suggestions First post btw! |
Author: | TylerL [ Fri May 26, 2006 1:45 am ] |
Post subject: | |
Wow, I didn't clean that up before I posted it, don't mind the redundant code |
Author: | TheOneTrueGod [ Fri May 26, 2006 7:28 am ] | ||
Post subject: | |||
Not bad, not bad, though some code optimization wouldn't hurt. It works pretty well, but i'll touch on some conceptual things. #1)You could compress this entire procedure into like three lines if you just use Math.Angle and some trig.
#2) Instead of having mousecheck as a procedure, have it as a function. Then you can just call it directly into the checks where it needs to be. #3) Your spacing kinda hurt my eyes. Generally, you don't want a space in between every line, but if it helps you organize better, go ahead. |
Author: | [Gandalf] [ Sat May 27, 2006 12:09 pm ] | ||
Post subject: | |||
TheOneTrueGod wrote: You could compress this entire procedure into like three lines if you just use Math.Angle and some trig.
I'm assuming you added a Math.Angle function to your Math module? Tut tut, you should remember that not everyone has made this addition. I'd guess you just added your previously posted:
TylerL, in Turing you don't need the brackets after a procedure or function declaration if it takes no parameters. It might help you notice that it's a function, but it's not neccessary. |
Author: | upthescale [ Sat May 27, 2006 2:51 pm ] | ||
Post subject: | |||
[Gandalf] wrote: TheOneTrueGod wrote: You could compress this entire procedure into like three lines if you just use Math.Angle and some trig.
I'm assuming you added a Math.Angle function to your Math module? Tut tut, you should remember that not everyone has made this addition. I'd guess you just added your previously posted:
TylerL, in Turing you don't need the brackets after a procedure or function declaration if it takes no parameters. It might help you notice that it's a function, but it's not neccessary. u must no actionscript then? o and put View.Set("offscreenonly") at the top, u got the view update, just not the offscreenonly part! |
Author: | [Gandalf] [ Sat May 27, 2006 5:24 pm ] |
Post subject: | |
upthescale wrote: [Gandalf] wrote: ...
u must no actionscript then? o and put View.Set("offscreenonly") at the top, u got the view update, just not the offscreenonly part! What? Why did you quote my post? What does actionscript have to do with anything? Actionscript is a programming language used with flash animations, which doesn't exactly relate to Turing. |
Author: | beforelast [ Sun May 28, 2006 2:13 pm ] |
Post subject: | |
becasue what he si refering to is a method that is usedi naction script. some things require a () after it |
Author: | wtd [ Sun May 28, 2006 2:19 pm ] | ||||||
Post subject: | |||||||
[Gandalf] wrote: TylerL, in Turing you don't need the brackets after a procedure or function declaration if it takes no parameters. It might help you notice that it's a function, but it's not neccessary.
They're parentheses, not brackets. Don't be 99% right then get lazy and not get the terminology wrong. Parentheses:
Braces:
Brackets:
|
Author: | NikG [ Thu Jun 01, 2006 11:15 pm ] |
Post subject: | |
Umm... when you refer to brackets in BEDMAS, what do you refer to? () or []? |
Author: | Clayton [ Thu Jun 01, 2006 11:39 pm ] |
Post subject: | |
either way it doesnt matter, all wtd is pointing out is that terminology makes a difference in the programming world, though not so much in the math world where parnetheses () are called brackets [] |
Author: | [Gandalf] [ Fri Jun 02, 2006 11:59 pm ] |
Post subject: | |
wtd wrote: They're parentheses, not brackets. Don't be 99% right then get lazy and not get the terminology wrong.
Indeed, you really have been cracking down on this lately. My excuse though is that more people will understand what I mean by brackets than parentheses. Ok, so that wasn't a good excuse... |