heres a really simple quiz game frame work i banged up in a few mins. i thought i might post it here for everyone to enjoy/modify/improve. any way here it is
you need a .txt file with info in the folowing order
[line1] number of questions total;needed only once
[line2]the question text
[lines3-5]answer text
[line6] answer number 1-4
[line7] and image path(e.g. im1.jpg)
repeat line2-7 for each question
have fun.
[edit] heres a sample quiz text.
2;the number of questions
question 1. what is my name?
1. bob
2. frank
3. ike
4. mayaman101
4;answer number
im1.jpg;image path
question 2. where is this posted?
1. yahoo
2. BRL forums
3. nerd.com
4. jqebef;v;eiwovioewbioeb
2
im2.jpg
please note the comments will show up so remove them from the text file.
;quizzing game v 1.1 Graphics 800,600,32 SetBuffer BackBuffer() AppTitle "quiz game","thank-you for playing" Global filein=OpenFile("quiz.txt"),score=0 Global qnum%=ReadLine(filein) Color 0,0,0 ;main program updatequestions() WaitKey():Delay 100 ;functions Function updatequestions() If qnum=0 Delay 1000:Cls:Locate 0,0:Print "score "+score:Delay 1000:End q1$=ReadLine$(filein) a1$=ReadLine$(filein) a2$=ReadLine$(filein) a3$=ReadLine$(filein) a4$=ReadLine$(filein) answer%=ReadLine(filein) impath$=ReadLine(filein) im=LoadImage(impath) qnum=qnum-1 While Not KeyHit(1) Cls Locate 0,0 DrawImage im,0,0 Print q1 Print a1 Print a2 Print a3 Print a4 Print qnum ;Print answer ;answer checking. x=Input("ready!, answer! ") If x<>answer Print "wrong answer try again":Delay 1000:score=score-1 If x=answer Print "good job":Delay 1000:score=score+1:updatequestions() Wend End Function
you need a .txt file with info in the folowing order
[line1] number of questions total;needed only once
[line2]the question text
[lines3-5]answer text
[line6] answer number 1-4
[line7] and image path(e.g. im1.jpg)
repeat line2-7 for each question
have fun.
[edit] heres a sample quiz text.
2;the number of questions
question 1. what is my name?
1. bob
2. frank
3. ike
4. mayaman101
4;answer number
im1.jpg;image path
question 2. where is this posted?
1. yahoo
2. BRL forums
3. nerd.com
4. jqebef;v;eiwovioewbioeb
2
im2.jpg
please note the comments will show up so remove them from the text file.