Screen 13 will be used within this tutorial. Screen 13 has a resolution of 320 x 200. This tutorial will show the screen coordinates.
The tutorial in the old QBasic Tutorial Series, regarding coordinates, was wrong. The old tutorial had screen coordinates of:
(0, 0)
(0, 200)
(320, 200)
(320, 0)
Since the starting coordinate is 0,0 that means that the math equation of n - 1 needs to be used. So, the farthest coordinate for Screen 13 is (320 - 1, 200 - 1) which gives us (319, 199).
The correct coordinates for each corner, of Screen 13, is:
(0, 0)
(0, 199)
(319, 199)
(319, 0)
PSET will place a pixel at a specified coordinate and color.
Code Download
QBT26_1.BAS - Incorrect Coordinates
QBT26_2.BAS - Correct Coordinates
QB64 is a free download at www.qb64.com
QB64 Wiki & Manual is found at qb64.com/wiki.html
QBasic 1.1 comes with OldDOS. A zip file of OldDOS can be found at www.pcxt-micro.com/download.html
QBasic 1.1 needs DOSBox to run on Windows Vista and greater, Mac, and Linux.
DosBox is a free download at www.dosbox.com
Free QB64/QBasic Code
QBasic.Net - www.qbasic.net
Pete's QBasic Site - www.petesqbsite.com/index.php
QB45 - qb45.org
Phatcode - games.phatcode.net