Computer Science Canada FLEXABLE ARRAYS! |
Author: | TokenHerbz [ Tue Oct 04, 2005 11:03 pm ] | ||
Post subject: | FLEXABLE ARRAYS! | ||
this is a classic example of my code screwing up cause i lack knowledge or these arrays which can change size... Anyways, Help me out please...
Yeah this one was slapped together to strengthin my "FLEXABLE ARRAY" skills, and i need help as the FREAKING TUTOREAL IS CRAP!!! yeah nothing makes sence in that crap, no offence or anything, but its not newb friendly? maybe i just cant understand it... who knows.. |
Author: | [Gandalf] [ Tue Oct 04, 2005 11:17 pm ] |
Post subject: | |
Cervantes' tutorial is great imo, it seems noob-enough-friendly. Maybe you should first learn everything (or most) before it in the Turing Walkthrough. Quickly looking at your code, try looking up records too. |
Author: | TokenHerbz [ Wed Oct 05, 2005 12:34 am ] |
Post subject: | |
nah i make it nice for actually codes, like pong, tic tac toe, RPG, etc:: Believe you me i know most of it, just not flexible arrays, its as if i have to make the for flexible to eh? Well just help me? |
Author: | [Gandalf] [ Wed Oct 05, 2005 12:51 am ] |
Post subject: | |
Well, you will be more likely to get help using more meaninful variable names. Instead of sz, you should be using ballSize, or better yet ball.size (hence the records). Also, one key problem is that you have the obstacles being flexible, while things like obstacle direction are not. Each obstacle needs this info, so it all needs to be flexible. An easy way of doing this is putting all that data into a record, and making that flexible. These are just some of the problems with your code. |
Author: | wtd [ Wed Oct 05, 2005 1:42 am ] | ||||||
Post subject: | |||||||
And for the love of everything unholy, use whitespace!
There's no good reason for this, as opposed to:
Or using Turing convention:
|
Author: | Cervantes [ Wed Oct 05, 2005 3:24 pm ] |
Post subject: | Re: FLEXABLE ARRAYS! |
tokenherbz wrote: i need help as the FREAKING TUTOREAL IS CRAP!!!
yeah nothing makes sence in that crap, no offence or anything, but its not newb friendly? maybe i just cant understand it... who knows.. My tutorial? Keep in mind it assumes you have a solid understanding of regular arrays. It also semi- assumes you know something about records, though if you don't you can just skip over the few (one?) parts that require it. What do you find difficult about it? Have you spent time figuring out how the examples work? Tutorials often aren't going to solidly teach you everything if you read through it quickly once. tokenherbz wrote: Well just help me? We're not obligated to. Ask kindly. |
Author: | TokenHerbz [ Wed Oct 05, 2005 9:24 pm ] |
Post subject: | |
ok Canavas... Please help me... in the future! 2nd off, Please dont tell me to code how you would code, ill code how i please, for short expamles i use QUICK names as to not waste time, and i DO use good names in complex, or longer codes... this goes along the with procs and etc: if i want to make sloppy quick examples to test stuff out, then i will, and i know better to make everything nice and neat, for once again, the longer more complex stuff... Though i will start to use more records, Any pointers to know when you should use them??? So far i only use them in my RPG... For the hero's and weps, etC: The things i need multiples for.. 3rd off, Canavas, i figured it out, i was messing up the for statments... |
Author: | [Gandalf] [ Wed Oct 05, 2005 10:36 pm ] |
Post subject: | |
Make an flexible array of a record as I said above. If you want people to help you, whether it benefits your example code of not, I suggest making it as easy for them as possible. When having variables like sz, you are encrypting to code, li if ea sid ts. |
Author: | Mr. T [ Wed Oct 05, 2005 10:45 pm ] |
Post subject: | Alex's Opinion |
tokenherbz wrote: Canavas
Cervantes. |
Author: | [Gandalf] [ Wed Oct 05, 2005 10:48 pm ] |
Post subject: | Re: Alex's Opinion |
Pwned wrote: tokenherbz wrote: Canavas
Cervantes. Clevernuts |
Author: | TokenHerbz [ Thu Oct 06, 2005 12:10 am ] | ||
Post subject: | |||
ok... my bad on the spelling :S Um, well ill fidle with it and post what i got tonight if i do it, i might not have time, we will see I like to meditate, and read up on mind expanding things 1st... ::: E D I T ::: ------------------- BAH!!!!! Fusteration kicks in, tutorial in hand... and im stuck again! I must say i hate these damn flexible arrays :S
So What do you see wrong with this?? Please help me?? Anyone??? ::: E D I T ::: ----------------- Forgot to add my PS message P.S. Dear Gandalf, i made GOOD VARIABLE NAMES!!! just for you! Now i hope you can understand my code, and help me Over and out Peace |
Author: | beard0 [ Thu Oct 06, 2005 8:01 am ] |
Post subject: | |
Try tracing your program; you'll note that you never leave the spawn more balls procedure. Tracing is generally a good debugging tactic. Actually, I'm not sure how turing delas with that... does turing allow the upper bound of a for loop to change, if the expression used to define it changes value? Hm... the computer I'm on now doesn't have Turing, so I can't test. Tracing would still be a good idea. |
Author: | TokenHerbz [ Thu Oct 06, 2005 9:26 am ] | ||
Post subject: | |||
it dosn't even run, and the errors are that it says my variables are not declared... So i looked harder to see that i was missing "int"
and what now, just as much errors if not more :S |
Author: | Tony [ Thu Oct 06, 2005 10:54 am ] | ||
Post subject: | |||
records are decleared as
|
Author: | [Gandalf] [ Thu Oct 06, 2005 2:53 pm ] | ||||
Post subject: | |||||
The record is a variable, so you need to call the record...
Or, if you change the code to reflect this new knowledge, a better variable name would be:
*edit* Tony, you don't need to make it a type, it can be a variable as well. |
Author: | Cervantes [ Thu Oct 06, 2005 3:38 pm ] | ||
Post subject: | |||
tokenherbz wrote: ok... my bad on the spelling :S
Does this mean you actually misspelled it again? I thought it was a joke on the first one! Except this time you added an extra 'a'. For arrays of records:
beard0 wrote: Try tracing your program; you'll note that you never leave the spawn more balls procedure. Tracing is generally a good debugging tactic.
Actually, I'm not sure how turing delas with that... does turing allow the upper bound of a for loop to change, if the expression used to define it changes value? Hm... the computer I'm on now doesn't have Turing, so I can't test. Tracing would still be a good idea The bounds of the for loop are evaluated once. So no, it would not remain stuck in that procedure. |
Author: | TokenHerbz [ Fri Oct 07, 2005 11:31 am ] |
Post subject: | |
Cervantes, your names really hard to spell, it must be french or somthing.. Anyways i go it, (copy and paste) |
Author: | codemage [ Fri Oct 07, 2005 12:16 pm ] |
Post subject: | |
Quote: it must be french or somthing..
Spanish. Google or wikipedia it. |
Author: | TokenHerbz [ Fri Oct 07, 2005 2:43 pm ] |
Post subject: | |
whats it mean? |
Author: | [Gandalf] [ Fri Oct 07, 2005 2:46 pm ] |
Post subject: | |
codemage wrote: Google or wikipedia it.
It's a name btw. |