Quick Basic Source [Public Domain]
All code presented here is Public Domain and provided AS IS. No claims of suitability or usefulness are made. Any use or adaptation is the sole responsibility of the user. It is free, and likely to be worth what it cost! (Many QB modules and algorithms work in VB or VBA as well!)
[ 
Download All
 ]
FILE NAME
(12hpset - ALARMBOBS)
File descriptions follow file names.
12HPSET.BAS
Show patterns using PSET in
mode 12h.
2BINARY$.BAS
Make a binary string from an
integer value.
320X240.BAS
Doug Lusher's Modex for
Qb4.5.
320X240Q.BAS
Modex for Qbasic Interpreter
or QB4.5.
4LEVEL.BAS
Graphic effect using PUT and
GET.
5LEAF.BAS
Alex Wellerstein's graphic
effect using DRAW.
826_BIT.BAS
Encode 8-bit characters in
6-bit text format.
AH-CIRC.BAS
Andy Hayes' circle graphic.
ALEXSAVE.BAS
Alex Wellerstein's polygon
screen effect.
ALRMBOBS.BAS
Shade bobs with a really
annoying sound effect.
.
FILE NAME
(ANIMA5 - AW_WOW)
File descriptions follow file names.
ANIMA5.BAS
Tony Caves' graphic animation
example program.
ANIMA6.BAS
An update to the Anima5.BAS
program.
ANSIFUNC.BAS
Put .ANS data into a function
returning a string.
ANSISHOW.BAS
Display .ANS files without
ANSI.SYS in QBasic/QB.
ANSISUB.BAS
A QB SUB to display .ANS
file without ANSI.SYS.
ARG!!.BAS
A simple game for QB/QBasic in
mode 13h.
ARGS_EX.BAS
Count command line arguments
in QB.
AURORA.BAS
Changing text background by
palette manipulation.
AW_WOW.BAS
Alex Wellerstein's bouncing
logo graphic.
.
.
.
FILE NAME
(A_WORM - BIGSTR)
File descriptions follow file names.
A_WORM.BAS
Text mode 'worm' eats
characters and restores
screen on exit.
BALLS.BAS
Dave Morrow's metallic
spheres graphic in mode 13h.
BAS2BAS.BAS
Converts number from one
numerical base to another.
BASMENU.BAS
QBasic menu launch QBasic
programs (reads directory).
BCOPY.BAS
Opens file in BINARY and
writes it elsewhere.
BEACHBAL.BAS
Bouncing ball animation demo
in mode 12h.
BEEP!.BAS
Some sound effects in QBasic.
BEES.BAS
Richard Dale's screen effect
in mode 12h.
BIGPALET.BAS
Rotating the palette in mode
13h to use more colors.
BIGSTR.BAS
Input routine to edit big
string in limited space.
FILE NAME
(BIN-LONG - CABLEOFF)
File descriptions follow file names.
BIN-LONG.BAS
Convert long integers to
variable len binary strings.
BIN_RAND.BAS
Using BINARY and RANDOM file
modes with data bases.
BIOSCRSR.BAS
Setting the DOS cursor for
console output in QB.
BLOSSOM.BAS
Matthew Pulley's mode 13h
graphic display.
BOUNCEB.BAS
Dave Morrow's bouncing balls
graphic for mode 13h.
BRESNHAM.BAS
Using Bresenham circle and
line algorithms in mode 13h.
BRITEBAK.BAS
Changing the palette to use
other text background colors.
BSV&LD.BAS
Demonstrates using BSAVE and
BLOAD for mode 13h screens.
BUBBLES.BAS
Mode 12h circles come at you
like blown bubbles.
CABLEOFF.BAS
Mode 7h random static graphic
effect (copycat cableout.BAS).
FILE NAME
(CABLEOUT - CHR_CODE)
File descriptions follow file names.
CABLEOUT.BAS
Dave Morrow's mode 7h random
static graphic effect.
CARDPICS.BAS
Mode 12h demo to draw, save,
load and display data.
CARDS.BAS
Text mode deck creation,
display and shuffling demo.
CARDSANY.BAS
Create and shuffle Poker and
Tarot decks in QBasic.
CGSCRLBR.BAS
Carl Gorringe's text mode
scroll bar.
CHARGEN.BAS
8x12 Character set generator.
Binary character data files.
CHNGE_EX.BAS
QBasic code to make change
using least bills/coins.
CHRCOUNT.BAS
Count occurrences of a given
character in a file in QB.
CHRSTRIP.BAS
Strips non-alphnumeric
characters from a file.
CHR_CODE.BAS
Shows the CHR$ codes of keys
pressed.
FILE NAME
(CHRCOUNT - CNVRTBAS)
File descriptions follow file names.
CHRCOUNT.BAS
Count occurrences of a given
character in a file in QB.
CHRSTRIP.BAS
Strips non-alphnumeric
characters from a file.
CHR_CODE.BAS
Shows the CHR$ codes of keys
pressed.
CIRC1.BAS
Makes a smiley face using
CIRCLE in mode 12h.
CIRCBURN.BAS
A variation on
Mike Castelli's
mode 13h grapic display.
CIRCFILL.BAS
Mode 12h graphic display
with time and date display.
CIRCSAV.BAS
Variation on Circfill.BAS with
text screen restore.
CLOTH.BAS
Andrew K. Dart's mode 12h
graphic display looks like fiber.
CNVRTBAS.BAS
Demo of numerical base
conversion in QBasic.
.
.
FILE NAME
(COLRBAKC - DAYOWEEK)
File descriptions follow file names.
COLRBAKC.BAS
James Broadbent's mode 12h
message box display.
COMMAS.BAS
Putting commas into numerical
strings in QBasic.
COMPARRY.BAS
Comparing array contents in
QBasic.
CONCAT.BAS
Concatenates files divided
using SPLITTER.BAS.
CONFETTI.BAS
Mode 13h grapical display
resembles falling confetti.
CONSANSI.BAS
Read and display .ANS files
using ANSI.SYS in QBasic.
CURDIR.BAS
Find current working
directory with SHELL command.
CYBPUNK.BAS
Mode 13h moving text
demonstration.
DAYERROR.BAS
Returns day of week as DOS
errorcode. QB .EXE only.
DAYOWEEK.BAS
QBasic routines to figure
day of week.
FILE NAME
(DELAY_EX - ERRLEV)
File descriptions follow file names.
DELAY_EX.BAS
Example of using BIOS clock
for an elapse timer.
DICE.BAS
A simple dice game in QBasic.
DICT.BAS
Parses text file into 26
sorted files with no dupes.
DICTNARY.BAS
Parse and merge sort
text file into alpha sort
word list.
DIEFLY.BAS
Aaron Tucker's mode 13h
display looks like a fly.
DIRLIST.BAS
Scrolling directory list for
QB only.
ELVIS.BAS
Window input routine with
password ability.
ERASE_EX.BAS
Example of using ERASE with
dynamic arrays.
ERRCODES.BAS
QBasic SUB with error codes
given as strings.
ERRLEV.BAS
Return errorlevel in
standalone QB .EXE.
FILE NAME
(EXE_APND - FILECOMP)
File descriptions follow file names.
EXE_APND.BAS
Binary append of data to an
existing .EXE file.
EXTPALET.BAS
Palette rotation in QBasic.
EZBOBS.BAS
Shade bobs in mode 13h.
FADE-IO.BAS
Fading text in and out using
PALETTE.
FADE13.BAS
Using hardware palette access
to fade a graphic display.
FAKEDOS.BAS
A fake DOS lists directories
but won't run anything.
FASTBOBS.BAS
Another mode 13h shade bobs
implementation.
FERN.BAS
Rodney Taylor's fern leaf
fractal display.
FILEBAG.BAS
Qbasic tool to bundle and
separate files.
FILECOMP.BAS
Compare the contents of two
files in QBasic.
.
.
FILE NAME
(FILETEST - GAMEBASE)
File descriptions follow file names.
FILETEST.BAS
Test existence of a file in
QBasic using ON ERROR.
FINDIGIT.BAS
SUBs to extract alpha and
numeric data from strings.
FINDTEXT.BAS
QBasic example of search a
file for a text string.
FIREWORK.BAS
Dave Morrow's mode 12h
fireworks graphical display.
FIRWRKS2.BAS
Dave Morrow's mode 13h
fireworks graphical display.
FLAME2.BAS
Mathew Robertson's 13h
flames graphical display.
FLOPS.BAS
Nick Beltran's mode 13h
metal bars graphical display.
FOREST.BAS
James McMurrin's graphic demo
of a math principle.
FREAK.BAS
Kevin Krumwiede's mode 12h
graphic demo with CIRCLE.
GAMEBASE.BAS
A collection of routines
forming the base for a game.
FILE NAME
(GAMEOVER - HDWSCRL1)
File descriptions follow file names.
GAMEOVER.BAS
Nathan Bright's big letters
in graphics example.
GASKET.BAS
Kevin Krumwiede's mode 12h
demo of a Sierpinski gasket.
GET13PUT.BAS
Using GET and PUT to
save/restore a mode
13h screen.
GETKEYS.BAS
Using INKEY$ to get keyboard
input.
GRAPH.BAS
James Broadbent's realtime
graphing example.
GRAVPAD.BAS
Reading the Gravis Gamepad
in QBasic.
GRIDMENU.BAS
Highlited grid type menu
for QBasic.
HDWRSCRL.BAS
Earl Montgomery's attempt at
hardware scrolling.
HDWSCRL1.BAS
Earl Montgomery's 1st example
of hardware scrolling.
.
.
FILE NAME
(HDWRSCR2 - JMSAVE)
File descriptions follow file names.
HDWRSCR2.BAS
Earl Montgomery's 2nd example
of hardware scrolling.
HEX32DEC.BAS
Qbasic routines for
hexatridecimal conversions.
HISCOREX.BAS
Maintain a sorted high scores
file in QBasic.
HIWORLD.BAS
Controlling the keyboard LEDs
in QBasic.
HPTRAILZ.BAS
Bouncing lines in mode 12h.
HTM2html.BAS
Rename all files with .htm
to .html with QBasic.
INERTIA.BAS
Graphical example of
implementing gravity
and intertia.
INVNTORY.BAS
Screen interface example for
use with a database.
JDBUB.BAS
Joshua Dickerson's rising
bubbles graphic display.
JMSAVE.BAS
James McMurrin's line based
graphical display.
FILE NAME
(KBARR - KS_PAC)
File descriptions follow file names.
KBARR.BAS
Routine to read keyboard and
track keys in array.
KEYCMD.BAS
Simple example of using
KBARR routines in program.
KEYDEFS.BAS
Using extended keys such as
cursor, home, and end.
KEYQUIK.BAS
Reading keyboard hardware
port to speed input.
KEYSHOW.BAS
Shows scan codes for keys
when pressed.
KISSED.BAS
Keep It Simple Stupid Editor
- a text editor program.
KKSTARS.BAS
Moving starfield display in
mode 12h.
KMSCROLL.BAS
Read and provide scrolling
display of a file.
KMSTARZ.BAS
Kevin Moonlight's 2D
scrolling starfield.
KS_PAC.BAS
Kevin Smith's Pacman graphic
animation display.
FILE NAME
(KWIKVIEW - MENU02)
File descriptions follow file names.
KWIKVIEW.BAS
Reads and prints a text file.
LABEL.BAS
Reads disk label using SHELL
and a temp file.
LEAPDAYS.BAS
Routine to identify leap
years.
LIGHTBAR.BAS
Example of using a scrolling
light bar to select text.
LLED.BAS
Simple editor showing use of
linked lists in QBasic.
LONGFN.BAS
Use SHELL command to get
long file names from DOS.
MAPMAKER.BAS
Define, save, and load
example terrain map in QBasic.
MARQUEE.BAS
Theater marquee style text
box for QBasic.
MATHOP.BAS
Parse basic math operations
with *, +, -, and /.
MENU02.BAS
Keydriven menu with animated
prompts.
.
FILE NAME
(MODE13H - ONKEY)
File descriptions follow file names.
MODE13H.BAS
Simple animation in mode 13h.
MOON.BAS
Douglas Lusher's moon
bombardment graphic display.
MOVE_EX.BAS
Example of moving a character
on a terrain map.
NAMEBASE.BAS
Example of creating/accessing
a database in QBasic.
NDXCRLF.BAS
Creates an index array
of CR/LF pairs for Binary
viewers.
NOBEEP.BAS
Using direct video writes to
display odd characters.
NOBLINK.BAS
Text mode with 16 background
colors QB4.5 only.
NULSHELL.BAS
Redirect SHELL command
output to NUL device.
NUMBERS.BAS
Print numerical values as
text EX. one, two, three.
ONKEY.BAS
Using ONKEY to make hot keys
for your programs.
FILE NAME
(OOP - PLASMA3)
File descriptions follow file names.
OOP.BAS
Data encapsulation in QBasic
using a STATIC SUB.
PALPAL.BAS
Hardware palette manipulation
to fade in/out and restore.
PALROT$.BAS
Rotate palette forward and
backward via hardware access.
PARMS.BAS
Set and read your program
parameters in QBasic.
PARSCMD.BAS
Parse QB command line into
array and count arguments.
PASSTYPE.BAS
Pass defined types and edit
them in secondary modules.
PCXVIEW.BAS
Show a 320x200 .PCX file in
mode 13h in QBasic.
PLANETS.BAS
Joshua Dickerson's graphic
planetary motion demo.
PLASMA.BAS
Ian Remmler's graphic plasma
display.
PLASMA3.BAS
Ian Remmler's graphic plasma
display, complete.
FILE NAME
(PLAYMOVE - PRNTEST)
File descriptions follow file names.
PLAYMOVE.BAS
Moving graphical sprites in
a playfield with obstacles.
PLOTXY.BAS
Plot points proportionally
to a graphic display.
PLYRMOVE.BAS
Use GET and PUT to move
sprite retaining background.
POCKET.BAS
Demonstration of fixed
length strings in QBasic.
POKE12.BAS
Generate random graphic
patterns in mode 12h.
POLYSAVE.BAS
Moving polygon graphic
display with palette changes.
POPUPS.BAS
Demo using pop-up menus in
QBasic.
POSTIT72.BAS
Make QBasic decodable files
for text transmission.
PRIME.BAS
Find primes in QBasic and
display with quick scroll.
PRNTEST.BAS
Get error report from the
printer port in QBasic.
FILE NAME
(PUTCHAR - R-W-TEST)
File descriptions follow file names.
PUTCHAR.BAS
Using direct video access to
read/write characters.
PUTPIX12.BAS
Compare QBasic 12h routines
to manual pixel writes.
QBERRS.BAS
Error list for error
trapping in QBasic.
QBLANDER.BAS
Playable Lunar lander game
in mode 13h for QBasic.
QBMEMV.BAS
View your active RAM in
hex/ascii using QBasic.
QPOSTIT.BAS
Postit!7.2 modified to be
used in QBasic uncompiled.
QUIKTERM.BAS
Basic terminal emulation
with ANSI emulation
in QBasic.
QUIKVIEW.BAS
Displaying .ANS files in
QBasic with ANSI.SYS loaded.
QWKREAD.BAS
Douglass Lusher's QWK packet
reader (for QB only).
R-W-TEST.BAS
File I/O example in QBasic.
FILE NAME
(READ_INI - ROTLINE)
File descriptions follow file names.
READ_INI.BAS
Using .ini files with QBasic.
READRAND.BAS
Creates index of a text file
and prints a random line.
READSCR.BAS
Reads input data from screen
display.
REGKEY.BAS
Example of creating and
testing registration keys.
RGB-FLOW.BAS
Bouncing discs graphic
display in mode 12h.
RGB13FLO.BAS
More bouncing discs in mode
13h this time.
RNDOP_EX.BAS
Example of generating random
opponents in QBasic.
RNDSTR.BAS
Example of randomizing the
contents of a string.
ROMANS.BAS
Convert integers to roman
numeral strings.
ROTLINE.BAS
Delete oldest line in file
when adding new one..
.
FILE NAME
(ROUND2X - SETCAPS)
File descriptions follow file names.
ROUND2X.BAS
Round to n places without
PRINT USING in QBasic.
SANDR.BAS
Search and replace for
QBasic strings.
SCALFONT.BAS
Creating and Use scalable
graphic mode fonts in QBasic.
SCREEN7.BAS
Using multiple screens in
mode 7h.
SCROLBOX.BAS
Resizable scrollbox with
text hi-lite.
SCROLL12.BAS
Smooth scrolling text in
graphic mode 12h.
SCROLL13.BAS
Smooth scrolling text in
graphic mode 13h.
SCROLLY.BAS
Scroll text in text mode.
SEETIME.BAS
Read and display the BIOS
clock.
SETCAPS.BAS
Set CAPSLOCK to on or off
in QBasic.
.
FILE NAME
(SHIFT - SPHERES)
File descriptions follow file names.
SHIFT.BAS
Bit shifting emulation for
QBasic.
SHIFTED.BAS
Show shift status by reading
BIOS shift bits.
SHOWKEYS.BAS
Show CHR$ value of keys.
SHOWTIME.BAS
Display time onscreen while
waiting for key input.
SLWPRNT.BAS
Ray Turner's slow print
routine.
SNOW.BAS
Mode 13h graphic display
resembling falling snow.
SP13H.BAS
Mode 13h graphic display
using lines and palette
changes.
SPACEEYE.BAS
Mode 12h graphic display
resembling an eye.
SPEK.BAS
Mode 13h graphic display.
SPHERES.BAS
Mode 13h graphic display
emulating spheres.
.
FILE NAME
(SPHERES2 - STEEL)
File descriptions follow file names.
SPHERES2.BAS
Mode 13h graphic display
emulating spheres.
SPLITTER.BAS
Break large files into 1M
sections.
SPRITE.BAS
Write data directly to PUT
buffer.
SPRITMSK.BAS
Smooth sprite animation with
background in Mode 13h.
SPRSAVE.BAS
Save and load sprite data
using arrays.
STARRUSH.BAS
Mode 12h starfield
simulation with forward
motion.
STARS_DR.BAS
David Rothschild's starfield
display for Mode 12h.
STARZ.BAS
Stephen van Loendersloot's
paralax scrolling starfield.
STEEL.BAS
Tony Cave's steel ball Mode
13h graphic screen effect.
.
.
FILE NAME
(STR2LONG - TBSTARZ)
File descriptions follow file names.
STR2LONG.BAS
Returns the value of a
numerical string with commas.
STRWIN.BAS
A string input window for
QBasic.
STRZ_TC.BAS
Tony Cave's forward motion
starfield for Mode 12h.
SUBGOSUB.BAS
Illustrates the differences
between SUB and GOSUB.
SUBTUTOR.BAS
Tutorial program on the use
of QBasic SUBs and FUNCTIONs.
SVGA_XTB.BAS
800x600x256 SVGA Graphical
display - lines and palettes.
TAPETIME.BAS
Tool for calculating total
time for musical selections.
TAXCALC.BAS
A first program : calculates
sales tax.
TBSTARZ.BAS
Tyler Barnes' moving
starfield display for
Mode 13h.
.
.
FILE NAME
(TBSTARZ2 - TRIANGLE)
File descriptions follow file names.
TBSTARZ2.BAS
Tyler Barnes' forward moving
starfield display for Mode 12h.
TESTCOLR.BAS
Test palette colors for VGA
text modes for redefine.
TESTDISK.BAS
Test disk status with QBasic.
TEXTVIEW.BAS
A limited simple text viewer
for QBasic.
THEWOODS.BAS
A playable text-based
adventure game for QBasic.
TILES.BAS
Graphic display using tiles
in Mode 12h.
TIRED.BAS
Mandie N.'s Mode 13h
graphical display.
TIRED2.BAS
A variation on Mandie N.'s
mode 13h display.
TREKWAR.BAS
Denis Boyles' animated
graphic display.
TRIANGLE.BAS
Carl Gorringe's variation on
a Sierpinski gasket.
.
FILE NAME
(TRIFRACT - WRDCOUNT)
File descriptions follow file names.
TRIFRACT.BAS
Carl Gorringe's second
variation on Sierpinski
gaskets.
TSMYST.BAS
Trevor Sinclair's QBasic
version of Mystify Your Mind.
VESA101.BAS
Vesa Mode 101h 60x480x256
graphic display for QB only.
VESA102.BAS
Vesa Modes 101h and 102h
example code for QB only.
VESABROT.BAS
Earl Montgomery's Mandelbrot
sets in SVGA Vesa modes.
VGASCROL.BAS
Smooth scroll text in VGA
modes using PUT and GET.
VIRTSCRN.BAS
Douglas Lusher's extended
scrolling screen for QBasic.
WILLTELL.BAS
The William Tell Overture
using the QBasic PLAY command.
WRDCOUNT.BAS
Count the number of words in
a text file in QBasic.
WRDCNT2.BAS
Count words in a text file and
track occurrence in QBasic.
.
FILE NAME
(WUMPUS2 - YINYANG)
File descriptions follow file names.
WUMPUS2.BAS
Playable text based game,
Hunt the Wumpus.
XMASTUNE.BAS
Aaron Tucker's Qbasic Xmas
tune jukebox using PLAY.
YINYANG.BAS
Alex Wellerstein's YinYang
graphic effect
.