
-----------------------------------
pwnapple
Tue Jan 24, 2006 3:28 pm

millionaire game
-----------------------------------
Is this how i should be starting my game?

%Who wants to be a millionaire
%20.01.05
const amt := 2

var questions : array 1 .. amt of string
var answers : array 1 .. amt of string

%data to be stored in datafile
%questions
questions (1) := "1) What best describes ice?"
questions (2) := "2) According to a common phrase, 'There is no place like' what?"

%answers
answers (1) := "Cold"
answers (2) := "Home"

%writes questions to file
var fileNum : int
open : fileNum, "questions.seq", put

for xx : 1 .. amt
    put : fileNum, questions (xx)
end for

close : fileNum

And if i were to read this file, would i changeopen : fileNum, "questions.seq", put 
to
open : fileNum, "questions.seq", get
thx

-----------------------------------
person
Tue Jan 24, 2006 5:10 pm


-----------------------------------
yes

-----------------------------------
person
Tue Jan 24, 2006 5:11 pm


-----------------------------------
i think the edit button just disapeared on me, but i meant to say u should use read instead of get

-----------------------------------
sylvester-27
Wed Jan 25, 2006 12:54 pm


-----------------------------------
there is no edit button in the help forum. Also, the program doesn't run. i press run and it finishes execution. might wanna fix that. maybe i have a screwed over computer but it doesn't work.

-----------------------------------
Albrecd
Wed Jan 25, 2006 1:36 pm


-----------------------------------
The reason it doesn't do anything is because you do not have a file called "questions.seq" on your computer (unless by some really strange coincedence...   :shock: )

-----------------------------------
Rasta Fella
Wed Jan 25, 2006 3:13 pm


-----------------------------------
As a matter of fact...I have recently been doing a "Who Wants To Be A Miliionaire" game for my 
Witch you stole from some one eltes.....


-----------------------------------
Clayton
Wed Jan 25, 2006 3:20 pm


-----------------------------------
it is the way you should start, however, instead of writing all the questions in the program, just write them all in a seperate editor window and save them there, just makes the program easier to look at, right start though

-----------------------------------
Clayton
Wed Jan 25, 2006 3:21 pm


-----------------------------------
same for the answers too
god i hate there being no edit button, why isnt there, ne1 know?

-----------------------------------
Delos
Wed Jan 25, 2006 3:52 pm


-----------------------------------
Yes.  Abuse.

Also, person, I'm curious as to why you favour read: to get: for retrieving file data.  I've personally found get: to be the easier of the two - but then that was a very subtle difference and may just be personal preference.

-----------------------------------
Clayton
Wed Jan 25, 2006 3:59 pm


-----------------------------------
Yes.  Abuse.

abuse in what way

-----------------------------------
[Gandalf]
Fri Jan 27, 2006 10:39 pm


-----------------------------------
This has been covered many times, use the search button.  Makes me think there should be a sticky of all the current 'situations' on compsci "things to know before posting".  

It was decided as a prevention for people who were deleting their help topics after recieving help, in which case others can't learn from your questions.  Hopefully this issue will be resolved soon.
