Computer Science Canada Capitals of Canada Quiz |
Author: | Jessica359 [ Wed Mar 26, 2008 3:22 pm ] | ||
Post subject: | Capitals of Canada Quiz | ||
Earlier on I posted a Canada Quiz which with people's help I finaly finished but then my teacher told me that we weren't aloud to use loops and I used a For Loop so I had to rechange my program to fit "his" standards. So this s my new problem that I came accross. First British Columbia shows up and you have to write the capital and so on. We have to display the amount of tries that they have out of 3. After 3 the program moves on to the next province. Which it doesn but when it moves on to Alberta and the person gets it wrong it keeps counting the number of tries left from 4 instead of going back down to 0.
I would as someone else in my class but they aren't that far yet. Thanks ![]() Jess |
Author: | Mackie [ Wed Mar 26, 2008 3:25 pm ] |
Post subject: | RE:Capitals of Canada Quiz |
A few things... First off your teacher should be glad you went ahead. Secondly you should really use better variable names. I can't try your program though, you need to package the images with the program. |
Author: | Jessica359 [ Wed Mar 26, 2008 3:57 pm ] |
Post subject: | RE:Capitals of Canada Quiz |
you can just take the images and sound out its just for decaration. Everything else works fine its just the count (variable "c") that won't start over after you change question. It keeps counting from te last question instead of starting over. |
Author: | Sean [ Wed Mar 26, 2008 3:57 pm ] | ||
Post subject: | Re: Capitals of Canada Quiz | ||
You have c, being the chances they took. You'll want an if statement to check what c is to do the next thing..
If they keep getting wrong, you will want it to check for another interval of 3 every other map. Got it? And if your teacher doesn't allow for-loops because you are ahead, then tell them off and do it anyways. |
Author: | Tony [ Wed Mar 26, 2008 4:13 pm ] |
Post subject: | Re: Capitals of Canada Quiz |
Sean @ Wed Mar 26, 2008 3:57 pm wrote: you will want it to check for another interval of 3 every other map.
That wouldn't work because if I have c == 9, you can't know if I made 3 mistakes on 3 questions or all 9 on the 3rd. Besides, that's not what the question asks. The counter is supposed to start over from 0, so you need to set c to be 0 before starting each question. Also, c is a pretty bad variable name. |
Author: | Sean [ Wed Mar 26, 2008 4:21 pm ] | ||
Post subject: | Re: Capitals of Canada Quiz | ||
Ah, re-read the question and saw my mistake. You can still use the if statement from above, but add in c := 0 inside the statement. And then each question will check for a 3 counter.
|
Author: | Insectoid [ Wed Mar 26, 2008 5:34 pm ] |
Post subject: | RE:Capitals of Canada Quiz |
I guess its a good thing my teacher spent 3 days doing 'proper naming of variables, constants, etc.'? 1 letter names are BAD! It makes it confusing for you if you ever leave this project and come back to it later, and difficult for these good people to help you. looking at the code, I don't even know what var : c is, except that it's a number! |
Author: | Sean [ Wed Mar 26, 2008 5:40 pm ] | ||||
Post subject: | Re: Capitals of Canada Quiz | ||||
Well, your variables are these..
You have one variable that is understandable, which is Answer, the others aren't. You should change your variables to this so you can remember what they are for...
Also, you can click on the beaver without using GUI, look up Mouse.Where |
Author: | Clayton [ Wed Mar 26, 2008 8:13 pm ] |
Post subject: | RE:Capitals of Canada Quiz |
I'm surprised no one has noticed this yet, but what's with that big honking loading procedure? If I had to sit through that, I might have to off myself. Not only does it not take that long to load images, but it's entirely pointless. Don't make your user sit through something they don't have to. |
Author: | Tony [ Wed Mar 26, 2008 9:56 pm ] |
Post subject: | Re: RE:Capitals of Canada Quiz |
Sean @ Wed Mar 26, 2008 5:40 pm wrote: You have one variable that is understandable, which is Answer
Actually even that is ambiguous. It could be (and as a comment suggested) a placeholder for user's answer, but taken out of context (such as when only a part of the code is examined), it could be thought of as the answer we are looking for. A better name would be user_response Clayton @ Wed Mar 26, 2008 8:13 pm wrote: I'm surprised no one has noticed this yet...
I don't actually run any Turing source anymore.. until someone buys me a copy of VM Fusion. I just read it now, so such parts are skipped over. also Re: loading bars @ /blog |
Author: | Jessica359 [ Thu Mar 27, 2008 7:41 am ] | ||
Post subject: | RE:Capitals of Canada Quiz | ||
Wow, um ok thanks guys with your help I got it to work. This was all I was missing
chance =0 to tell it to restart over again. YAY ![]() Also thanks for the advice on the variables I remaned them and it does make it less confusing. For the Loading procedure it was part of the project outline, we needed to show that the program was "loading" for a specific period of time. Really useless but its the project outline. |
Author: | Tallguy [ Thu Mar 27, 2008 8:05 am ] |
Post subject: | Re: Capitals of Canada Quiz |
sup jess. you should really zip your folder so we can get the pics. and my program is better then urs ![]() ![]() Clayton wrote: I'm surprised no one has noticed this yet, but what's with that big honking loading procedure? If I had to sit through that, I might have to off myself. Not only does it not take that long to load images, but it's entirely pointless. Don't make your user sit through something they don't have to. we had to have a loading or a splash screen in out program (i'm in her class ![]() |
Author: | Tony [ Thu Mar 27, 2008 9:48 am ] |
Post subject: | Re: RE:Capitals of Canada Quiz |
Jessica359 @ Thu Mar 27, 2008 7:41 am wrote: For the Loading procedure it was part of the project outline...
Could somebody please forward a link to the above blog article on Loading Bar Anti-Pattern to that teacher? |
Author: | Mackie [ Thu Mar 27, 2008 11:43 am ] |
Post subject: | RE:Capitals of Canada Quiz |
That's sad what could the teacher be thinking? That's not teaching good habits, or anything for that matter. |
Author: | Tony [ Thu Mar 27, 2008 12:03 pm ] |
Post subject: | RE:Capitals of Canada Quiz |
While at it, I hope you guys are not taught to use the Waterfall model |
Author: | Jessica359 [ Thu Mar 27, 2008 1:13 pm ] |
Post subject: | RE:Capitals of Canada Quiz |
Ur program is NOT better then mine "Tall Guy" (and u ain't even that tall!) ![]() Ya its our teacher's first year teaching the course and he has to catch everyone else up in the class because were only 3 that have some basic but he won't let us get ahead because its "unfair" to the others. Frig that! I haven't learned anything new yet! lol anyways thanks again ever1 ![]() |
Author: | Tallguy [ Fri Mar 28, 2008 12:47 pm ] |
Post subject: | Re: Capitals of Canada Quiz |
Quote: Ur program is NOT better then mine "Tall Guy" (and u ain't even that tall!)
oooo, that hurts Jess, u said urselve my program was better, ![]() ![]() Quote: I haven't learned anything new yet! lol
i so agree, we're doing the same prgrams as last year ![]() |