Page 1 of 2
So you want to be a programmer, eh?
Posted: Sat Feb 28, 2004 10:16 pm
by Interon
It can be a tedious, boring job for those new to it. You need lots of patience and persistence if you are ever to do anything useful with it. To make DOS games, try QBasic. It is easier than C++ and Assembler and is a great way to get started.
Here, take some code from me to get you started. This is a simple trivia game. Replace the questions and answers with what you want to use.
This code might help you learn QBasic.
Code: Select all
1 CLS
CLEAR
GOSUB QUESTION1
GOSUB QUESTION2
QUESTION1:
LOCATE 1, 1:INPUT "What is the capital of Canada?", Q$
IF UCASE$(Q$) = "OTTAWA" THEN CLS
IF UCASE$(Q$) = "OTTAWA" THEN LOCATE 1, 1: PRINT "Correct!"
IF UCASE$(Q$) = "OTTAWA" THEN LOCATE 2, 1: PRINT "Press any key to continue . . ."
IF UCASE$(Q$) = "OTTAWA" THEN DO: LOOP WHILE INKEY$ = ""
IF UCASE$(Q$) = "OTTAWA" THEN RETURN
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
QUESTION2:
LOCATE 1, 1:INPUT "What color is coal?", Q$
IF UCASE$(Q$) = "BLACK" THEN CLS
IF UCASE$(Q$) = "BLACK" THEN LOCATE 1, 1: PRINT "Correct!"
IF UCASE$(Q$) = "BLACK" THEN LOCATE 2, 1: PRINT "Press any key to continue . . ."
IF UCASE$(Q$) = "BLACK" THEN DO: LOOP WHILE INKEY$ = ""
IF UCASE$(Q$) = "BLACK" THEN RETURN
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
Posted: Mon Mar 01, 2004 12:54 pm
by donkeydude
yeah, got qbasic.
Is it just regular BASIC, or is it different?
Posted: Mon Mar 01, 2004 8:40 pm
by Interon
It is a more complicated version of BASIC. It uses most of the old BASIC commands so that you could open a BASIC file in QBasic and about 99% of the time it should run. However, QBasic has lots of extra stuff that BASIC doesn't. It's like comparing Windows 3.1 to Windows 95.
Posted: Tue Mar 02, 2004 2:52 pm
by donkeydude
what, like more commands? sounds good...
Posted: Tue Mar 02, 2004 3:09 pm
by Interon
Yeah, that, and separate subroutines, and higher limits. It is a relatively new Basic, by Microsoft, a major player in the Basic programming language versions.
Posted: Thu Apr 22, 2004 7:13 pm
by Icedragon
QBasic is cool. I like downloading the games like nibbles and gorrila, and screwing with the colours.
Posted: Thu Apr 22, 2004 7:49 pm
by laogaming
AHHHHH!!! QBASIC AHHHHH!!!!!!! man i hated basic when i started it, i love c
Posted: Tue Jul 06, 2004 12:56 am
by ripster88
Where do you get Qbasic????
Posted: Tue Jul 06, 2004 2:03 am
by emmzee
You can download QBasic as part of the "old DOS" package, right from Microsoft's FTP site:
ftp://ftp.microsoft.com/softlib/mslfiles/olddos.exe
Posted: Tue Jul 06, 2004 4:52 am
by Nixon
Ya should get Qb 4.5 or higher cause you can make .exe with it.
try searching in google cuase I'm to lazy to find a link.
I been programmingin Qb for a few years, but firsat I started In zzt.
Posted: Wed Jul 07, 2004 1:33 am
by ripster88
I managed to find Qb 4.5. Thanks guys, I'm gonna try it out now.
Say, does any of you know where I could get some games so I can play around with them??? (I've already got the one above)
Posted: Wed Jul 07, 2004 3:42 pm
by Interon
Invaders 1978 contains the source code
Posted: Thu Jul 22, 2004 3:41 am
by Game master pro
I cant download it, it says "the page cannot be displayed thing" are you sure you got it right
Posted: Sat Jul 24, 2004 11:12 pm
by barok
This site offers all versions of qb, including some vb downloads.
http://www.download-qb.tk/
if you wish to start qb, the site i recommend is this:
www.qbasic.com
a good site to show you what can be made in qb:
www.vplanet.cjb.net
btw interon, your program is horribly inefficient. you do way too many of the same checks over and over.
1 CLS
CLEAR
GOSUB QUESTION1
GOSUB QUESTION2
QUESTION1:
LOCATE 1, 1:INPUT "What is the capital of Canada?", Q$
answer$ = ucase$(Q$)
IF answer$ "OTTAWA" THEN CLS
LOCATE 1, 1: PRINT "Correct!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
endif
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
QUESTION2:
LOCATE 1, 1:INPUT "What color is coal?", Q$
answer$ = ucase$(Q$)
IF answer$ = "BLACK" THEN CLS
LOCATE 1, 1: PRINT "Correct!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
endif
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
furthermore you continually use do: loop while inkey$ = "". to make the code easier to read, easier on the fingers and to minimize syntax errors, you should create a waitkey subroutine that waits until a keypress.
Posted: Sun Jul 25, 2004 1:45 pm
by Interon
Yeah, despite making 4 games, I'm still kind of an amateur.
Posted: Sun Jul 25, 2004 2:24 pm
by barok
4 games isn't very many. Darkdread has over a dozen under his belt. Pity he's lost his interest in programming (again). He's starting to sound like micheal jordan. retires, comes back. retires again, comes back, etc. etc.
Being a good enough programmer to make a zelda quality game isn't easy either. I've been working on my game for what, two months? And it's still only a walkaround engine with scripted npc's. Currently i'm stuck with the bounding boxes for npc to npc collisions. It's very confusing.
Btw, i'd like to take a look at your games.
Posted: Sun Jul 25, 2004 3:00 pm
by Dogbreath
Speaking of Darkdread, did he ever finish Curby/Curty/Curly/whatever the hell it was/ 3 and Mysterious Song 2? I remember playing the demo and being rather impressed, but his site went down shortly after that.
Posted: Sun Jul 25, 2004 3:25 pm
by Interon
All 4 of them can be found on
http://www.dosgamesonline.com
They are called Diamond Grabber 1, Diamond Grabber 2, Cribbage Solitaire, and Letter Targets. Source code is included in all 4 of them (released under the GNU GPL version 2).
Lots of spaghetti code with little or no comments. Also, I did not use the SUBs because I was in no mood to learn them.
However, the games work as I planned them (except for a tiny mathematical bug in Cribbage Solitaire that I could never fix, but I tried very hard).
Posted: Mon Jul 26, 2004 9:04 am
by barok_lazee
you're talking about secret of cooey 3, right?
Do you have the mysterious song 2 demo? Think you could upload it somewhere or email it to me? I can't find it.
if you can, here's my email address.
[email protected]
Darkdread's games
legend of lith
legend of lith 2
secret of cooey
secret of cooey 2
secret of cooey 3 (unfinished)
mattress warrior (not what you think!)
lianne in: the dark crown
black rhino
mysterious song
mysterious song 2 (unfinished)
distant promises (demo)
in the nocturne
legend of grimtold (unfinished)
there's probably more that i'm missing...
Posted: Tue Jul 27, 2004 7:04 pm
by Wally
if they were more detailed like commander keen they would be awesome
seeing a ^ run everywhere in diamond grabber isnt that exciting