|
Post by Roofles Hunter on Jul 30, 2002 9:39:51 GMT
How can I make the variable charclass equal to whatever they choose...The let thing isn't working...Im dumb...Help meee. NAMECHOSEN: PRINT "Hello, "; charname$; " Welcome to the realm." PRINT "Around here...Everyone chooses a path." PRINT "What would you want to be?" PRINT "1. Swordsman" PRINT "2. Monk" PRINT "3. Archer" PRINT "4. Wizard" INPUT "It's your choice...What will you be?"; charclass$ IF b = 1 THEN;charclass$ = Swordsman PRINT "A "; charclass$; "? Are you sure?"
|
|
Not waving drowning
Guest
|
Post by Not waving drowning on Jul 30, 2002 13:13:45 GMT
Gday roofles - me again. Looks like your having a bit of a hard time of it. I remember when I first started using qbasic blah, blah, blah... Don't feel too stupid, we all started once.
Anyway, to cut a long story short, there are all different types of variables in qbasic. To keep it simple, variables that store numbers are written whithout the dollar sign - ie the variable Charchoice can only hold numbers, while variables that store text (called string variables) are written with a dollar sign - ie charname$ can only hold letters. Variables a way more versatile than just this - but this should get you out of trouble for the time being.
Put in a search for a set of tutorials called Pete's Qbasic Tutorials. I'd give you the link but I don't have it any more. At the end of his tutorials you'll have all the tools (and a few extra) to create a text based RPG.
Soldier on...
|
|
Not waving drowning
Guest
|
Post by Not waving drowning on Jul 30, 2002 13:29:36 GMT
Sorry mate, read your question wrong!!
(Who's the dickhead now!!)
Here's the change you need to make
NAMECHOSEN: PRINT "Hello, "; charname$; " Welcome to the realm." PRINT "Around here...Everyone chooses a path." PRINT "What would you want to be?" PRINT "1. Swordsman" PRINT "2. Monk" PRINT "3. Archer" PRINT "4. Wizard" INPUT "It's your choice...What will you be?"; b IF b = 1 THEN charclass$ = "Swordsman" PRINT "A "; charclass$; "? Are you sure
You could also use SELECT CASE INKEY$ if you don't want to have to push enter after every choice - see if you can find that Petes Qbasic Tutorial - it's all in there.
|
|
|
Post by Roofles Hunter on Jul 30, 2002 20:51:24 GMT
Heh...Thanks alot buddy...It's just, The dumbass tutorials that my school uses, Deals all with math. I didn't have the slot open to take QBasic this year, Or any other programming language for that matter...But I swiped my friends older brothers workbook...And all it deals with is mathimatical variables...I find math useless by itself...Heh...All the stuff I know how to do is cheap calculator programs, And programs that can find answers to a complex formula with just one or two inputs...Well good days ahead, I will try and find that tutorial site...And whoa, Pete is my name. -.o Maybe this guy that is lucky enough to share my name will be more helpful...Hahaha.... -Hip, Hip Roofles Hunter
|
|
|
Post by programmer on Jul 30, 2002 22:55:34 GMT
|
|