Who Wants To Be A Millionaire!
Author |
Message |
Vexxel
|
Posted: Tue Jan 24, 2012 6:00 pm Post subject: Who Wants To Be A Millionaire! |
|
|
What is it you are trying to achieve?
I am trying to make the millionaire game consisting of 9 questions.
What is the problem you are having?
I don't know how to detect that the question #1 is correct and move on to the next one. ( How to advance from 1 -> 2)
Describe what you have tried to solve this problem
I have tried many things, such as using randint, etc. None of it seemed to work.
Please specify what version of Turing you are using
4.11
It would be much appreciated if you guys could help me out today because my culminating is due tomorrow. Thank you very much.
Description: |
|
 Download |
Filename: |
Game.rar |
Filesize: |
7.89 MB |
Downloaded: |
1642 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Beastinonyou

|
Posted: Tue Jan 24, 2012 6:52 pm Post subject: Re: Who Wants To Be A Millionaire! |
|
|
You should consider managing your time better, or at least try to seek help earlier, rather than later.
Basically, You could consider such a task by doing the following:
Turing: | var questions : array 1 .. 9 of string % Questions to answer
var answers : array 1 .. 9 of int % Set whatever your answers are, multiple choice, values 1 to 4
var questionCounter : int := 1
% Later in your program
% Display Question (questionCounter)
% Display Answers (questionCounter)
% Get Answer
if answer = answers (questionCounter) then
if questionCounter < 9 then
questionCounter += 1 % Counter to move onto next question
else
% You must have answered the last question correctly
end if
else
% You got the question wrong
end if
|
|
|
|
|
|
 |
Vexxel
|
Posted: Tue Jan 24, 2012 7:04 pm Post subject: RE:Who Wants To Be A Millionaire! |
|
|
We're not allowed to use arrays.
|
|
|
|
|
 |
RyGuy-Anime
|
Posted: Tue Jan 24, 2012 7:32 pm Post subject: Re: Who Wants To Be A Millionaire! |
|
|
use a whole bunch of ifs then like if answer = a or answer = A then ...
that or a data file
|
|
|
|
|
 |
Beastinonyou

|
Posted: Tue Jan 24, 2012 8:36 pm Post subject: Re: RE:Who Wants To Be A Millionaire! |
|
|
Vexxel @ Tue Jan 24, 2012 7:04 pm wrote: We're not allowed to use arrays.
so you're superior wishes you to hardcore every variable like so:
Turing: | var answerA : int
var answerB : int
var answerC : int
var answerD : int
var answerE : int
var answerF : int
var answerG : int
var answerH : int
var answerI : int |
or, similarly:
Turing: | var answerA, answerB, answerC, answerD, answerE, answerF, answerG, answerH, answerI : int
|
opposed to the more efficient, effective, and line-conserving:
Turing: | var answers : array 1 .. 9 of int
|
I don't understand why.. maybe they don't want you using something you don't understand how to use. But if you do understand how to use them, why should you be restricted to use this concept?
|
|
|
|
|
 |
mirhagk
|
Posted: Wed Jan 25, 2012 12:21 am Post subject: RE:Who Wants To Be A Millionaire! |
|
|
What school is restricting you from using arrays at the end of the course? What school hasn't taught you arrays by the end of the course? (this assignment at my school is like 1/4 of the way through the grade 10 course)
|
|
|
|
|
 |
|
|