The QBasic / QB64 Discussion Forum      Other Subforums, Links and Downloads
 
  << Previous Topic | Next Topic >>Return to Index  

Text only millionaire game.

May 16 2005 at 11:09 PM
New Kid  (no login)

when you get this game, it would be nice if you could beta test it for me. E-mail: millcreekfarms@kansas.net

INPUT "Would you like blue leters (press 1) or green letters (2)"; x
IF x = 1 THEN Y = 1
IF x = 2 THEN Y = 2
color1:
COLOR Y, 0
PLAY "MBT160O1L8CDEDCDL4ECC"
INPUT "What's your name?"; x$
PRINT x$; " let's play Who Wants to be Filthy Rich!"
PRINT " By Micah and Nick Warren"
PRINT " Programed by Nick Warren"
PRINT " DISCLAIMER: The winnings in this game are hypotheti-"
PRINT " cal no real money will be given!"
PRINT x$, "for 100 dollars what is the only bird in the world that has a better sense of smell than humans?"
INPUT "Is it 1-the roadrunner, 2-the ostrich, 3-the kiwi, or 4-the lyre bird? Type your answer here"; N
IF N = 3 THEN PRINT "THAT IS CORRECT!"
IF N = 3 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 200 dollars what are the dark lava filled craters on the moon called?"
INPUT "Is it 1-the mare, 2-the marianas trenches, 3-canals, or 4-the dark side of the moon? Type your answer here"; S
IF S = 1 THEN PRINT "THAT IS CORRECT!"
IF S = 1 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 300 dollars what year was The Beatles seargant peppers lonely hearts club band released?"
INPUT "Is it 1-1963, 2-1967, 3-1969, or 4-1964? Type your answer here"; B
IF B = 2 THEN PRINT "THAT IS CORRECT!"
IF B = 2 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 500 dollars Where are the worlds largest buildings-the Petronas Towers-located?"
INPUT "Is it 1-Seoul, Korea, 2-Sydney, Australia, 3-Chicago, Illinois, or 4-Kuala Lampur, Malasia? Type your answer here"; F
IF F = 4 THEN PRINT "THAT IS CORRECT!"
IF F = 4 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 1000 dollars when did Babylonian troops led by Nebuchadnezzar destroy Jerusalem and take King Zedekiah prisoner?"
INPUT "Is it 1-586 B.C., 2-479 B.C., 3-532 B.C., or 4-661 B.C.? Type your answer here"; Q
IF Q = 1 THEN PRINT "THAT IS CORRECT!"
IF Q = 1 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 2000 dollars When did the last full-scale cavalry charge take place?"
INPUT "Is it 1-November 1941, 2-October 1942, 3-April 1945, or 4- January 2003 ? Type your answer here"; Z
IF Z = 1 THEN PRINT "THAT IS CORRECT!"
IF Z = 1 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 3000 dollars what geological era comes before the Jurasic?"
INPUT "Is it 1-The Cambrian, 2-The Tertiary, 3-The Cretaceous, or 4-The Triasic? Type your answer here"; t
IF t = 4 THEN PRINT "THAT IS CORRECT!"
IF t = 4 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 5000 dollars When was wheat first cultivated by farmers in the middle east?"
INPUT "Is it 1-6000 B.C., 2-999 B.C, 3-8000 B.C., or 4-2000 B.C.? Type your answer here"; W
IF W = 3 THEN PRINT "THAT IS CORRECT!"
IF W = 3 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 100,000 dollars What type of woods is said to be innedible to termites?"
INPUT "Is it 1-oak, 2-pine, 3-Elm, or 4-Walnut? Type your answer here"; G
IF G = 2 THEN PRINT "THAT IS CORRECT!"
IF G = 2 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 200,000 dollars when did the unification of upper and lower Egypt take place?"
INPUT "Is it 1-312 B.C.,2-3100 B.C.,3-2100 B.C., or 4-22,000 B.C.?"; L
IF L = 2 THEN PRINT "THAT IS CORRECT!"
IF L = 2 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 300,000 dollars what is the largest satelite?"
INPUT "Is it 1-the hubble space telescope 2- the international space station 3- the moon or 4-sputnik?"; K
IF K = 3 THEN PRINT "THAT IS CORRECT!"
IF K = 3 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT x$, "for 500,000 dollars how high is the international space station?"
INPUT "Is it 1-3000 miles 2- 220 miles 3-230 miles or 4- 14 miles?"; Y
IF Y = 2 THEN PRINT "THAT IS CORRECT!"
IF Y = 2 THEN PLAY "T160O1>L20CDEDCDL10ECC" ELSE END
PRINT "and finaly for 1,000,000 dollars what country does Christmass island belong to?"
INPUT "Is it 1-Panama 2-Madascar 3-Australia or 4-Ecuador?"; R
IF R = 3 THEN PRINT "THAT IS CORRECT! You just won a million dollars!"
IF R = 3 THEN PLAY "MBT160O1L8CDEDCDL4ECC" ELSE END


















 
 Respond to this message   
AuthorReply

(Login MCalkins)
R

Nice.

May 17 2005, 10:18 AM 

Here are a few recommended changes that should make it more flexible. This should make adding extra questions for each money level easier. If, for example, you have 3 or 4 questions for each money level, then you could choose randomly between them. (I didn't add the code for that, but the changes should make it easier to do.)
You are doing well for 4 months of expirience. Keep up the good work!
"You're under arrest, Chancellor."
"Are you threatening me, Master Jedi?"
Regards,
Michael

DEFINT A-Z 'added

INPUT "Would you like blue leters (press 1) or green letters (2)"; x
IF x = 1 THEN Y = 1
IF x = 2 THEN Y = 2
color1:
COLOR Y, 0
PLAY "MBT160O1L8CDEDCDL4ECC"
INPUT "What's your name?"; x$
PRINT x$; " let's play Who Wants to be Filthy Rich!"
PRINT " By Micah and Nick Warren"
PRINT " Programed by Nick Warren"
PRINT " DISCLAIMER: The winnings in this game are hypotheti-"
PRINT " cal no real money will be given!"

'from this point on, modified
DIM ques$(0 TO 12) 'arrays
DIM choi$(0 TO 12)
DIM answ%(0 TO 12)

GOSUB LoadData 'call subroutine

FOR i% = 0 TO 12

 which% = i% 'this can eventually be used in selecting random questions

 PRINT
 PRINT x$, ques$(which%)
 PRINT choi$(which%)
 PRINT "Type you answer here: ";
 DO
  k$ = INKEY$
  IF k$ = CHR$(27) THEN PRINT: PRINT: SYSTEM
  IF k$ = "1" OR k$ = "2" OR k$ = "3" OR k$ = "4" THEN EXIT DO
 LOOP
 PRINT k$
 IF VAL(k$) <> answ%(which%) THEN PRINT "Sorry, that's wrong": SYSTEM
 IF i% < 12 THEN
  PRINT "THAT IS CORRECT!"
  PLAY "T160O1>L20CDEDCDL10ECC"
 ELSE
  PRINT "THAT IS CORRECT! You just won a million dollars!"
  PLAY "MBT160O1L8CDEDCDL4ECC"
  SYSTEM 'ends the program
 END IF
NEXT i%

SYSTEM 'execution won't reach this line at present

LoadData: 'start of subroutine

ques$(0) = "for 100 dollars what is the only bird in the world that has a better sense of smell than humans?"
choi$(0) = "Is it 1-the roadrunner, 2-the ostrich, 3-the kiwi, or 4-the lyre bird?"
answ%(0) = 3

ques$(1) = "for 200 dollars what are the dark lava filled craters on the moon called?"
choi$(1) = "Is it 1-the mare, 2-the marianas trenches, 3-canals, or 4-the dark side of the moon?"
answ%(1) = 1

ques$(2) = "for 300 dollars what year was The Beatles seargant peppers lonely hearts club band released?"
choi$(2) = "Is it 1-1963, 2-1967, 3-1969, or 4-1964?"
answ%(2) = 2

ques$(3) = "for 500 dollars Where are the worlds largest buildings-the Petronas Towers-located?"
choi$(3) = "Is it 1-Seoul, Korea, 2-Sydney, Australia, 3-Chicago, Illinois, or 4-Kuala Lampur, Malasia?"
answ%(3) = 4

ques$(4) = "for 1000 dollars when did Babylonian troops led by Nebuchadnezzar destroy Jerusalem and take King Zedekiah prisoner?"
choi$(4) = "Is it 1-586 B.C., 2-479 B.C., 3-532 B.C., or 4-661 B.C.?"
answ%(4) = 1

ques$(5) = "for 2000 dollars When did the last full-scale cavalry charge take place?"
choi$(5) = "Is it 1-November 1941, 2-October 1942, 3-April 1945, or 4- January 2003 ?"
answ%(5) = 1

ques$(6) = "for 3000 dollars what geological era comes before the Jurasic?"
choi$(6) = "Is it 1-The Cambrian, 2-The Tertiary, 3-The Cretaceous, or 4-The Triasic?"
answ%(6) = 4

ques$(7) = "for 5000 dollars When was wheat first cultivated by farmers in the middle east?"
choi$(7) = "Is it 1-6000 B.C., 2-999 B.C, 3-8000 B.C., or 4-2000 B.C.?"
answ%(7) = 3

ques$(8) = "for 100,000 dollars What type of woods is said to be innedible to termites?"
choi$(8) = "Is it 1-oak, 2-pine, 3-Elm, or 4-Walnut?"
answ%(8) = 2

ques$(9) = "for 200,000 dollars when did the unification of upper and lower Egypt take place?"
choi$(9) = "Is it 1-312 B.C.,2-3100 B.C.,3-2100 B.C., or 4-22,000 B.C.?"
answ%(9) = 2

ques$(10) = "for 300,000 dollars what is the largest satelite?"
choi$(10) = "Is it 1-the hubble space telescope 2- the international space station 3- the moon or 4-sputnik?"
answ%(10) = 3

ques$(11) = "for 500,000 dollars how high is the international space station?"
choi$(11) = "Is it 1-3000 miles 2- 220 miles 3-230 miles or 4- 14 miles?"
answ%(11) = 2

ques$(12) = "and finaly for 1,000,000 dollars what country does Christmass island belong to?"
choi$(12) = "Is it 1-Panama 2-Madascar 3-Australia or 4-Ecuador?"
answ%(12) = 3

RETURN 'end of subroutine

 
 Respond to this message   
mennonite
(no login)

changing the colors

May 17 2005, 3:57 PM 


'that is a nice program... ha, you ripped the music off nibbles :D

'michael's idea is good, here's a way to change colors... i like blue better than green,
'but i think light blue (color 9) is easier to see than blue (color 1) so here's an exapansion of this code:

INPUT "Would you like blue leters (press 1) or green letters (2)"; x
IF x = 1 THEN Y = 1
IF x = 2 THEN Y = 2

'to this:

PRINT "press a letter for the following color:"
PRINT "would you like to see:"
PRINT
COLOR 1: PRINT "a. blue"
COLOR 2: PRINT "b. green"
COLOR 3: PRINT "c. cyan"
COLOR 4: PRINT "d. red"
COLOR 5: PRINT "e. magenta"
COLOR 6: PRINT "f. brown"
COLOR 7: PRINT "g. white"
COLOR 8: PRINT "h. grey"
COLOR 9: PRINT "i. light blue"
COLOR 10: PRINT "j. light green"
COLOR 11: PRINT "k. light cyan"
COLOR 12: PRINT "l. light red"
COLOR 13: PRINT "m. light magenta"
COLOR 14: PRINT "n. yellow"
COLOR 15: PRINT "o. bright white"
DO
sele$ = LCASE$(INPUT$(1))
LOOP UNTIL INSTR("abcdefghijklmno", sele$) > 0 ' keep going if answer not ok
y = INSTR("abcdefghijklmno", sele$) 'set y to new color (you'll still want to use COLOR y, 0 later)

 
 Respond to this message   
mennonite
(no login)

*failing that, at least add IF Y=0 THEN Y=2 'so that you never get black on black

May 17 2005, 4:33 PM 


 
 Respond to this message   

(Login MCalkins)
R

Cool.

May 17 2005, 9:58 PM 

Those are clever ways to use INSTR().
I would have used a SELECT CASE to determine correct input and then resolve the choice to a color.
INSTR() is much more compact. Nice!

 
 Respond to this message   
mennonite
(no login)

thanks!

May 18 2005, 10:03 AM 

i had a similar way of determining the color name, etc but while i was trying to come up with a more "for... next" way to name and number the colors, i found that the "compact" version was way more complex than needed, almost comically so, for two complications it resolved: one that all the colors after 8 were named bright something, but also that 8 and 14 are called gray and yellow, not "bright..."

all in all, the routine saved maybe half the lines vs the easy way, and probably used almost the same amount of code - so i decided to use something slightly longer that was really simple... the bit on the end with instr was the part i thought was worth keeping, and considering that you liked it, i'm glad i did. i like using instr for that.

 
 Respond to this message   
Current Topic - Text only millionaire game.
  << Previous Topic | Next Topic >>Return to Index  

Newbies usually go to www.qbasic.com and click on The QBasic Forum
Forum regulars have their own ways, which include The QBasic Community Forums