Computer Science Canada I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
Author: | hav0c0001 [ Sat Jun 09, 2007 8:20 am ] |
Post subject: | I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. It is sort of like a Jeopardy game. The glitches in my loops will not allow me to block of the question that has already been answer/clicked on. Do I need to redo it in a procedure format? or is it possible to re-configure my if statements with variables? If any of this is possible please let me know how, or if you require my code, leave your email. Thanks alot. |
Author: | Saad [ Sat Jun 09, 2007 9:11 am ] |
Post subject: | Re: I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
You could have a 2D array of boolean in which it stores if the question was used, or you can have a Question Record which stores if it was used |
Author: | hav0c0001 [ Sat Jun 09, 2007 9:13 am ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
and you are confident that will work? Do you think you can give me an example? Thanks alot |
Author: | Saad [ Sat Jun 09, 2007 11:30 am ] | ||
Post subject: | Re: I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. | ||
Yes i am heres a code to get you started
Saad |
Author: | hav0c0001 [ Sat Jun 09, 2007 12:01 pm ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
Thanks alot...ill giev it a try |
Author: | DIIST [ Sat Jun 09, 2007 3:07 pm ] |
Post subject: | Re: I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
K, you should try the examples the others provided, but also consider using classes. It can help you out on these kind of assignments. It helped my sister. ![]() |
Author: | hav0c0001 [ Sat Jun 09, 2007 8:49 pm ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
haha k cool thanks alot, but how do i know what example to check?:S i didnt see any trivia games posted:S |
Author: | hav0c0001 [ Mon Jun 11, 2007 9:43 am ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
for the code above...should my whole code in between? |
Author: | hav0c0001 [ Mon Jun 11, 2007 9:49 am ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
oh, sorry about that question above...it was a little bit confusing...i ment to ask if i need to put ever single one of my questions into that array...?:S thanks! |
Author: | hav0c0001 [ Mon Jun 11, 2007 9:55 am ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
Perhaps if you'd like to see my code...it's about 6000 lines long (all repeaditive copy and pasting) you can email me at Pat_5678@hotmail.com you might need to see it...it's a bit confusing... Thanks again:P |
Author: | berrberr [ Mon Jun 11, 2007 2:19 pm ] | ||
Post subject: | Re: RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. | ||
hav0c0001 @ Mon Jun 11, 2007 9:55 am wrote: Perhaps if you'd like to see my code...it's about 6000 lines long (all repeaditive copy and pasting) you can email me at Pat_5678@hotmail.com you might need to see it...it's a bit confusing... Thanks again:P
Nope I dont think anyone wants to sort through 6000 lines of if statements ![]() To answer your question, use someones suggestion of implementing an array of booleans that when false mean that that particular question has been answered already. One way to do this would be to have 2 seperate arrays - one array holding all your questions, and he second array holding the booleans of wether that question has been answered or not. This method would be really simple to create and implement. Heres a baisc example (in pseudo code of course ![]()
And thats about it. Very basic but it works. Also for a bit of a challenge, and to reduce the amount of lines in your code, try to implement an alternative method of storing all of your question/answers. I would suggest storing them in a text file, and then once you start up your program, open up that text file and assign the questions/answers to your various arrays. That would make things much, much better ![]() |
Author: | hav0c0001 [ Mon Jun 11, 2007 2:38 pm ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
haha thanks...and that array is for each and every question individually? oh and i dont think im gonna sort my code i got about 3 days to finish, ive barely been programming for 4 months in turing haha. |
Author: | Clayton [ Mon Jun 11, 2007 2:50 pm ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
instead of parallell arrays, I would suggest you check out records. This way, you can define your own type, create an array of this custom type, and overall keep things much more tidy. |
Author: | hav0c0001 [ Mon Jun 11, 2007 3:12 pm ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
:S more new stufff :S example if you dont mind please...id appreciate it very much... thanks alot! |
Author: | Clayton [ Mon Jun 11, 2007 3:44 pm ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
There's a full tutorial in the Turing Walkthrough. |
Author: | hav0c0001 [ Tue Jun 12, 2007 10:05 am ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
Failure is divided into 2 part. Those who thought and have not did, and those who did have not thought. I did both, and im still faling :S |
Author: | hav0c0001 [ Tue Jun 12, 2007 10:11 am ] |
Post subject: | RE:I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
One thing you must understand, is that it is a jeopardy program, which means the questions that the player chooses are not in a consecutive order. |
Author: | hav0c0001 [ Tue Jun 12, 2007 10:14 am ] |
Post subject: | Re: I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
Here is my code, if anyone help id appreciate it ![]() Edited by Clayton: Removed code, attach long code and use [code] tags next time. |
Author: | hav0c0001 [ Wed Jun 13, 2007 9:42 am ] |
Post subject: | Re: I am currently workin on a turing trivia game, however, i am at the point where there are glitches in my loops. |
Sorry, that code was incomplete, i couldnt past it all but here ill attach it. |