
-----------------------------------
balla16
Wed May 19, 2004 6:36 pm

Who Wants to be a Millionaire.....if-elsif statements!!!!!
-----------------------------------
I am currently doing my 30% summative now and have been assigned to do the game "Who wants to be a Millionaire." I have done all my graphics but I am having trouble setting up my if-elsif statements. The 5 choices 
I have are (1) 50/50 (2) Ask-The-Audience (3) Phone a friend (4) Correct answer or (5) Wrong answer. I am ending up with if statements within if statements within if statements etc.... Can someone help me out here????
Bare with me, I am new at this...

-----------------------------------
SuperGenius
Wed May 19, 2004 7:05 pm


-----------------------------------
if you post code we will be able to help you better rather than just guessing your problem

-----------------------------------
balla16
Thu May 20, 2004 10:02 pm


-----------------------------------
ok.....im narrowing my help down even more....i know have my structure as a "procedure" but i don't know how to make the procedure run only once and never again.

For example, if you use 50/50, i don't want the procedure to run those instructions again.....how do i do it?????

-----------------------------------
not_l33t
Fri May 21, 2004 12:42 pm


-----------------------------------
Dude your comming pretty close to being in the "Hall of Shame".

-----------------------------------
octopi
Fri May 21, 2004 1:04 pm


-----------------------------------
not_l33t 

he is comming no where close to the hall of shame.



balla16:
okay, if you want to limit it so that you can only use the 50/50 once, phone once, and poll the audience once, then you need to make 3 variables at the top of your program

5050used
pollused
phoneused

or something similar.

now, when someone selects the 50/50 in there you need to set that variable
5050used equal to a certain value. (doesn't matter what value)

then where you have if statements like

elsif Answer1 = "1" thenmake that
elsif ((Answer1 = "1") and (5050used not= THEVALUEABOVE)) then

where THEVALUEABOVE is the certain value that gets assigned to the 50/50 thing once its been used.


do you understand what is happening?

when you use the 5050 it records that it has been used, now, the next time someone tries to use it, it makes sure it hasn't been used yet.

-----------------------------------
MyPistolsIn3D
Fri May 21, 2004 2:50 pm


-----------------------------------
or make a boolean variable for each like:

phone : boolean := true

then when they select to use the phone:

if phone = true then
   (phone procedure)
else
   put "sorry you've already used the phone"
end if

-----------------------------------
balla16
Fri May 21, 2004 11:41 pm

Thanks!
-----------------------------------
Thanks a lot "MyPistolsIn3D" and "Octopi".....its nice to see people helping new programmers unlike other who come to criticize *not_l33t*
