Array help needed urgently! (responses asap please!)
Author |
Message |
NEEDSHELP
|
Posted: Tue Jun 09, 2009 7:20 pm Post subject: Array help needed urgently! (responses asap please!) |
|
|
What is it you are trying to achieve?
Okie, so like i'm making a little "Guess who's who"-type sort of game for my project. Arrays for question, option and answer strings are all working but not the one I want for my pictures. Is it possible to make arrays work for my pictures? And, what's wrong and what should I do to fix my code and make it work??
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Here's what I've done so far...
var qst :array 1 .. 8 of string
var OptA :array 1 .. 8 of string
var OptB :array 1 .. 8 of string
var OptC :array 1 .. 8 of string
var OptD :array 1 .. 8 of string
var aswr :array 1 .. 8 of string
var guess :string
var eye :array 1 .. 8 of int
var x :int:= 1
qst(1) := "To which animal does this eye belong to?"
qst(2) := "What about this one?"
qst(3) := "I see you... this is an eye of..."
qst(4) := "LOOK AT ME! Which animal now?"
qst(5) := "This is an eye?! But, who's?"
qst(6) := "And this one?"
qst(7) := "What animal has such a eye?"
qst(8) := "Ohh, pretty... Who has these?"
OptA(1):="Snake"; OptB(1):="Salmon"; OptC(1):="Desert Lizard"; OptD(1):="Frog"
OptA(2):="Porcupine"; OptB(2):="Cat"; OptC(2):="Dog"; OptD(2):="Wolf Cub"
OptA(3):="Lion"; OptB(3):="Wolverine"; OptC(3):="Antelope"; OptD(3):="Giraffe"
OptA(4):="White Wolf"; OptB(4):="Polar Bear"; OptC(4):="Owl"; OptD(4):="Arctic Fox"
OptA(5):="Jellyfish"; OptB(5):="Sea Cucumber"; OptC(5):="Octopus"; OptD(5):="Hippopotamus"
OptA(6):="Crocodile"; OptB(6):="Frog"; OptC(6):="Salamander"; OptD(6):="Eel"
OptA(7):="Ostrich"; OptB(7):="Rhinocerous"; OptC(7):="Turkey"; OptD(7):="Turtle"
OptA(8):="Lemur"; OptB(8):="Jumping Spider"; OptC(8):="Angler Fish"; OptD(8):="Caterpillar"
aswr(1) := "A"
aswr(2) := "C"
aswr(3) := "A"
aswr(4) := "C"
aswr(5) := "C"
aswr(6) := "B"
aswr(7) := "D"
aswr(8) := "B"
var eye1,eye2, eye3, eye4, eye5, eye6, eye7, eye8: int
eye(1):= Pic.FileNew ("eye1.bmp")
eye(2):= Pic.FileNew ("eye2.bmp")
eye(3):= Pic.FileNew ("eye3.bmp")
eye(4):= Pic.FileNew ("eye4.bmp")
eye(5):= Pic.FileNew ("eye5.bmp")
eye(6):= Pic.FileNew ("eye6.bmp")
eye(7):= Pic.FileNew ("eye7.bmp")
eye(8):= Pic.FileNew ("eye8.bmp")
Draw.Fill (500,300,7,7)
colourback (7)
colour (0)
loop
put qst(x)
Pic.DrawSpecial(eye(x), 450, 300, picCopy, picFadeIn, 1000)
put "A) ", OptA(x)
put "B) ", OptB(x)
put "C) ", OptC(x)
put "D) ", OptD(x)
put ""
get guess
end loop
I really, REALLY need to know the answer soon!
help would be great....thanks....
(P.S. - and would someone kindly suggest or tell me how to keep score of the results and make it viewable o the user how many points they have??) ~ as you can see, i'm not very instructed or developed, in that manner, in turing skills... ; that is why I really need help... |
|
|
|
|
|
Sponsor Sponsor
|
|
|
syntax_error
|
Posted: Tue Jun 09, 2009 9:41 pm Post subject: RE:Array help needed urgently! (responses asap please!) |
|
|
code: |
var score int
score = 0;
if choice = correct then
score ++;
else score -100000
cls
put score
if score > 1 bhal bhal
etc
|
|
|
|
|
|
|
NEEDSHELP
|
Posted: Tue Jun 09, 2009 10:27 pm Post subject: RE:Array help needed urgently! (responses asap please!) |
|
|
thank you...
but, let me see if i get this so far...
the score is the variable that will count whether or not the user got the right answer; right?
then, what's with the whole "score ++" and "score -1000" thing? i'm sorta of confused...
and the "if score>1"...sheesh, i really appreciate your help but i'm really lost...
any helpful explanations?? |
|
|
|
|
|
syntax_error
|
Posted: Tue Jun 09, 2009 10:33 pm Post subject: RE:Array help needed urgently! (responses asap please!) |
|
|
score will count how many the user got right, maybe I should be more clear, score ++ means score = score+1 and if they get it wrong you can go score --; or score = score-1 etc.
and last bit is if you want comments with the sore range if they got all of them right its a wow! you know your stuff etc
make any sense? |
|
|
|
|
|
|
|