Computer Science Canada Problem with manual collision checking |
Author: | ReCreate [ Sat Nov 07, 2009 2:12 pm ] | ||
Post subject: | Problem with manual collision checking | ||
What is it you are trying to achieve? Trying to get some collision checking to work... What is the problem you are having? The collision checking for the second object is not working Describe what you have tried to solve this problem I read over it several times, Rewrote the if statement to check the collision several times, And even showed it to some friends if they would notice anything wrong. 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.03 Ok so my problem is that for some reason, the first if statement for the collision checking does not work, I'm clueless, I read over it countless times And even rewrote it. Any help would be greatly appreciated. Thanks ~ReCreate |
Author: | Tony [ Sat Nov 07, 2009 2:38 pm ] | ||
Post subject: | RE:Problem with manual collision checking | ||
For what value of boxx will this be true?
|
Author: | ReCreate [ Sat Nov 07, 2009 2:51 pm ] |
Post subject: | RE:Problem with manual collision checking |
I don't get what you mean, Could you please rephrase that? |
Author: | TheGuardian001 [ Sat Nov 07, 2009 4:15 pm ] | ||||
Post subject: | Re: Problem with manual collision checking | ||||
ReCreate wrote: I don't get what you mean, Could you please rephrase that? If you were to sub in every x value from 1 to maxx, which ones would make that statement true. Let's take a look at your condition
Okay, now let's rearrange that a bit, to isolate boxx in both conditions. To do so, we'll subtract 20 from each side of the second condition. This gives us:
Which makes the problem a bit more obvious. Can you think of any number that is both less than and greater than maxx-40? |
Author: | ReCreate [ Sat Nov 07, 2009 5:23 pm ] |
Post subject: | RE:Problem with manual collision checking |
Well ummm... < and >'s tend to confuse me, I'm still not sure what the problem is, Do you mean that should do this instead? if maxx-40 < boxx and maxx-40 > boxx The X never moves, But Boxx does... Thanks ~ReCreate |
Author: | Tony [ Sat Nov 07, 2009 5:44 pm ] |
Post subject: | Re: RE:Problem with manual collision checking |
ReCreate @ Sat Nov 07, 2009 5:23 pm wrote: Well ummm... < and >'s tend to confuse me, I'm still not sure what the problem is
The problem is that comparison operators confuse you. Here's a simple exercise for you to complete. We can't really move on until that is done. Quote: Find all integer values of X such that a) 0 < x and x < 4 b) 1 < x and x < 3 c) 2 < x and x < 2 |
Author: | ReCreate [ Sat Nov 07, 2009 7:52 pm ] |
Post subject: | RE:Problem with manual collision checking |
Erm... Don't take this rude or anything, But you guys are strange...Usually you'd expect answers to be something more like "<code> Well there's your problem! <fixed code>" or "You did <something> wrong the right way is <something>". Well anyways, In the quote, What is the full question? It really doesn't make any sense. What do they mean by "such that "? |
Author: | Superskull85 [ Sat Nov 07, 2009 9:03 pm ] |
Post subject: | RE:Problem with manual collision checking |
What integer values of x would evaluate the given expression(s) to be true? Being able to evaluate expressions, and understand what statements are trying to tell you is probably the most important thing you need to know about computer science. If we just outright gave you the full solution you would not learn why, and how, your problem was fixed. Therefore you would probably not be able to solve a similar problem in the future. |
Author: | ReCreate [ Sat Nov 07, 2009 9:50 pm ] |
Post subject: | RE:Problem with manual collision checking |
*facepalms at perhaps the biggest misunderstanding in human history* I know that, But just letting you know, I'm not here to learn about computer science(yet), I'm just here to get some help on turing. I know what you mean, and you are right, But I just want to know what it is that is wrong, that is all I care to know. (don't take this the wrong way) |
Author: | TheGuardian001 [ Sat Nov 07, 2009 10:11 pm ] |
Post subject: | Re: Problem with manual collision checking |
Well, then you don't need anything here. Your problem is not a misunderstanding of Turing, it's a misunderstanding of how > and < work. Everything specific to Turing in this program (that you've shown us) is working, but if you don't understand how those work, you aren't going to get anywhere. |
Author: | Superskull85 [ Sat Nov 07, 2009 10:51 pm ] |
Post subject: | Re: RE:Problem with manual collision checking |
ReCreate @ Sat Nov 07, 2009 9:50 pm wrote: ...I'm not here to learn about computer science(yet), I'm just here to get some help on turing...
The problem is, like TheGuardian001 and Tony have stated, is that the only thing you don't understand is a general concept that can be applied to most high-level languages (including Turing). You say that you don't want to learn about computer science. However, every time you create a program you are in fact writing an implementation of one or more algorithms. Algorithms that can be created using computer science. When you debug code you are evaluating expressions (for example figuring out what the value of "-yvelocity" is), understanding a statement (for example understanding what "Music.Sound (440, 50)" does), understanding why you cannot store a boolean value in an int variable, etc. All of these tasks relate to computer science (and other software related disciplines) and are amongst the many things computer scientists are able to do. I'll bet that if you can figure out the answer to the question Tony asked, and understand it, you will be able to solve the problem you are experiencing with your code. |
Author: | ReCreate [ Sun Nov 08, 2009 5:25 pm ] |
Post subject: | RE:Problem with manual collision checking |
Ok, what is strange is, I ported my program to C++ and it works... Well anyways, In the question "Find all integer values of X such that" I don't get what it is asking, could you rephrase it? I know what < and > mean, I just sometimes forget what they are, like X and Y(I tend to forget what they are too >_<). |
Author: | Superskull85 [ Sun Nov 08, 2009 5:27 pm ] |
Post subject: | Re: RE:Problem with manual collision checking |
ReCreate @ Sun Nov 08, 2009 5:25 pm wrote: ...Well anyways, In the question "Find all integer values of X such that" I don't get what it is asking, could you rephrase it?...
What integer values of x would evaluate the given expression(s) to be true? |
Author: | Tony [ Sun Nov 08, 2009 5:36 pm ] |
Post subject: | RE:Problem with manual collision checking |
For example: 1 < x 1 is less than 2, so "1 < 2" is true. 1 is also less than 3, 4, 5... |
Author: | ReCreate [ Sun Nov 08, 2009 6:18 pm ] |
Post subject: | RE:Problem with manual collision checking |
Erm...is this what the question is asking? This is easy, I already know that. >_> |
Author: | Tony [ Sun Nov 08, 2009 6:38 pm ] | ||
Post subject: | RE:Problem with manual collision checking | ||
Could you post the answers though? Then also to the original question of Tony @ Sat Nov 07, 2009 2:38 pm wrote: For what value of boxx will this be true?
|
Author: | ReCreate [ Sun Nov 08, 2009 7:07 pm ] |
Post subject: | RE:Problem with manual collision checking |
Erm... All I did is copy and example and put in my own variables for it Anyways a) 0 < x and x < 4 b) 1 < x and x < 3 c) 2 < x and x < 2 a) anything larger than 0 and anything smaller than 4 b)anything larger than 1 and anything smaller than 3 c)anything larger that 2 and smaller that 2 (which is nothing if it is put together) Am I right? |
Author: | Tony [ Sun Nov 08, 2009 7:29 pm ] |
Post subject: | RE:Problem with manual collision checking |
Right so far. Now using the same approach, what values (if any) work for the boxx question above? |
Author: | ReCreate [ Sun Nov 08, 2009 9:20 pm ] |
Post subject: | RE:Problem with manual collision checking |
anything smaller than maxx-40 and anything larger than maxx-20? |
Author: | Tony [ Sun Nov 08, 2009 9:45 pm ] |
Post subject: | RE:Problem with manual collision checking |
no. |
Author: | ReCreate [ Sun Nov 08, 2009 10:06 pm ] |
Post subject: | RE:Problem with manual collision checking |
No? Then what? |
Author: | Tony [ Sun Nov 08, 2009 10:27 pm ] | ||||
Post subject: | Re: Problem with manual collision checking | ||||
TheGuardian001 @ Sat Nov 07, 2009 4:15 pm wrote: Let's take a look at your condition
Okay, now let's rearrange that a bit, to isolate boxx in both conditions. To do so, we'll subtract 20 from each side of the second condition. This gives us:
Which makes the problem a bit more obvious. Can you think of any number that is both less than and greater than maxx-40? |
Author: | ReCreate [ Sun Nov 08, 2009 10:38 pm ] |
Post subject: | RE:Problem with manual collision checking |
Oh so I got it backwards? If so, Now what? Edit: Oh I see, I put the numbers backwards, Just that, Was that *so hard* for you to tell me? |
Author: | Tony [ Sun Nov 08, 2009 11:02 pm ] |
Post subject: | RE:Problem with manual collision checking |
I'm not even sure what you think you got backwards... so no, that's not it. |
Author: | ReCreate [ Mon Nov 09, 2009 1:44 pm ] |
Post subject: | RE:Problem with manual collision checking |
It should have been if maxx-20 > boxx and maxx-40 < boxx + 20 Anyways, It works now, No thanks to you. *rolls eyes* |
Author: | efan41 [ Thu Nov 12, 2009 3:02 pm ] |
Post subject: | Re: Problem with manual collision checking |
They're trying to say that you are trying to find an integer number between 40 and ................40. Well you obviously haven't noticed that there isn't a single possible integer value between 40 and 40 seeing as integer values don't have decimals in them. And now that I think of it, you can't even have a decimal number between 40 and 40. I'd like to see the supposedly fixed code to see if he actually fixed it or he's just tired of us pointing out what he dosen't understand. |
Author: | ReCreate [ Sun Nov 18, 2012 12:06 am ] |
Post subject: | RE:Problem with manual collision checking |
Well, I DID fix is. I posted the working game in some other thread all those years ago. Jeez I was a jerk, though. Apologies, humanity. |