BASIC applications collection
Table of Contents
1. Applications
This collection contains lots of toy applications:
- Games.
- Graphics tests (2D/3D/4D).
- Algorithms tests.
- Utilities.
I wrote those applications mostly more than 20 years ago, mostly in QBasic. Because programs are old, coding style and commenting was often times bad. I'm now using artificial intelligence to revive and modernize them one by one.
Few examples:
1.1. Checkers
Play checkers against the computer with any board size and any amount of caps. Does thinking by recursively testing many possible scenarios with any depth.
Since it is slow QBasic implementation, it isn't practical to play with many caps or big thinking depth, for reasonable responce time.
1.2. 2D graphics demos and animations
1.3. Multiplayer game of worms
Game supports up to 5 players. Any amount of those players can be AI controlled. Game has multiple levels. After worms have eaten certain amount of fruits, game advances to the next level. Each worm has limited amount of lives. When worm runs into the wall or another worm, it loses one life.
Levels are stored in 'lvl' files that are directly editable using text editor.
1.4. Fractals
1.5. 3D Synthezier
Parses scene definition language and creates 3D world based on it. Result will be in a wavefront obj file, witch can be then visualized using external renderer.
See directory:
graphics/3D/3D Synthezier
1.6. Spiral series
Small collection of programs that are result of exploratory programming, for fun. It started out from drawing spiral on the screen. Every iteration built upon previous result.
2. Getting the source code
Programs author is Svjatoslav Agejenko
- Homepage: https://svjatoslav.eu (See also other software projects.)
- Email: mailto://svjatoslav@svjatoslav.eu
These programs are free software: released under Creative Commons Zero (CC0) license.
- Browse Git repository online.
- Download latest snapshot in TAR GZ format.
You can clone Git repository using git:
git clone https://www3.svjatoslav.eu/git/qbasicapps.git
3. Installation and Usage
There are various ways to run legacy QBasic applications under Debian GNU/Linux:
- Full system virtualization
- One way would be to use full system virtualization with QEMU, VirtualBox or VMware Workstation or Player. After creating virtual machine, you need to obtain and install some distribution of DOS like MS-DOS or FreeDOS. Within DOS you can then use either Microsoft QBasic or Microsoft QuickBasic. QBasic is already included in Microsoft DOS by default. QuickBasic is more capable but must be obtained separately.
- QB64
- QB64 is mostly compatible with Microsoft BASIC variants and can be used too.
- DOSBox + MS BASIC
- Easy to install and good compatibility.
3.1. DOSBox + MS BASIC
Following tutorial focuses on using DOSBox with original Microsoft QBasic or QuickBasic.
DOSBox is trivial to install and BASIC programs do not need to be copied to virtual drive or operating system to run them. Using original BASIC binaries ensures good compatibility.
Here is suggested installation and usage procedure:
Install DOSBox by running the following command in your terminal:
sudo apt-get install dosbox
Obtain and place a copy of QuickBasic QB.EXE executable binary into directory QB45 within project root directory.
Optionally obtain Volkov Commander executable VC.COM and place it under project root directory. Volkov Commander simplifies filesystem navigation and running arbitrary BASIC program by selecting it and pressing ENTER key. For this to work, BAS file extension is mapped to BASIC executable within VC.EXT file (already available in the project root directory). In case you are using QBasic instead, feel free to fix VC.EXT to point to appropriate BASIC executable.
- Optionally check and apply DOSBox usage tips.
Execute script that is located in the root directory of the repository:
./run_dosbox.sh
- Now project root directory appears as root directory of virtual C: drive. You can navigate around and start programs.
Here is suggested project directory layout with QuickBasic and Volkov Commander installed:
├── COPYING ├── index.org ├── QB45 │ ├── QB.EXE │ └── QB.INI ├── run_dosbox.sh ├── (... other repository files and directories) ├── VC.COM ├── VC.EXT └── VC.INI
3.2. DOSBox usage tips
3.2.1. How to change keyboard layout to Dvorak
In case you want to use Dvorak keyboard layout and DOSBox fails to auto-apply it, here is how you can set it manually:
Edit file:
~/.dosbox/dosbox-<version>.conf
Modify keyboardlayout field as follows
keyboardlayout=dv103
- Save the changes and restart DOSBox for the configuration to take effect.
3.2.2. Increase window size
If you have big high-resolution screen, by default DOSBox window could appear small. To make it bigger:
Edit file:
~/.dosbox/dosbox-<version>.conf
Set windowresolution to either of those values:
windowresolution=1366x768 windowresolution=1600x900
- Save the changes and restart DOSBox for the configuration to take effect.
3.2.3. Exit mouse capture
DOSBox detects when a game uses mouse control. When you click on the screen, it should get locked (confined to the DOSBox window) and work.
To release mouse lock, press:
CTRL-F10
3.2.4. Increase CPU speed for better animation smoothness
Many applications benefit from as fast CPU as possible. Games and animations that require limited frames per second always have their own CPU independent mechanisms for limiting animation speed. So setting CPU as fast as possible within emulator is beneficial.
This is how I accomplished it in DOSBox:
Edit file:
~/.dosbox/dosbox-<version>.conf
Edit [cpu] section accordingly:
[cpu] core=normal cputype=auto cycles=fixed 100000
- Save the changes and restart DOSBox for the configuration to take effect.