Those running linux: Qemu dosn't work quite right with this, but VirtualBox is ok.

You can get a disk image of the floppy for all this from http://eds.dyndns.org/~ircjunk/not_public_dont_open/qbasic.iso
boot up,
if the software asks for a date, just hit enter.
you get the prompt  a:/>
type  qbasic
hit escape to deny help, we dont need no help :)

Program 1:

type in the following
CLS
PRINT "Hello world"

press alt to get to the menu,
use the arrow keys to get to run, select start and hit enter

In this program:

Program 2:

CLS
print "Enter your name mortal ";
input name$
print "I will try to remember to not kill you "; name$

In this program:

Program 3:

CLS
print "Enter your name mortal ";
input name$
if name$ = "master" then goto sorry
print "I will try to remember to not kill you "; name$
end
sorry:
print "Oh its you, sorry master."

In this program:

Program 4:

CLS
print "Enter your name mortal ";
input name$
for n = 1 to 10
print "KILL "; name$

next n

This program:

Program 5:

CLS
print "Enter your name mortal ";
input name$
for n = 1 to 10
print "KILL "; name$

gosub stall
next n


stall:
for d = 1 to 1000
next n
return

This program:

Stop for a min!

ok, our programs are getting bigger and a little harder to read because of it.
We need to start using spacing to keep the code kinda readable, otherwise it all globs into a mess.
One of the things its good to do, is to push over code that is either in a repeat loop or conditional or on their own.

CLS
print "Enter your name mortal ";
input name$
for n = 1 to 10
   print "KILL "; name$

   gosub stall
next n


stall:
   for d = 1 to 1000
   next n
return

this way, its easier to see what is "in" what. It gets more important when your programs get complex

for a = 10 to 1 step -1
for b = 5 to 8
for c = 20 to 30 step 2
print "calculating matrix ";a;"x";b;"x";c
next c
next b
print
next a



for a = 10 to 1 step -1
   for b = 5 to 8
    for c = 20 to 30 step 2
      print "calculating matrix ";a;"x";b;"x";c
    next c
  next b
  print
next a

See how you can tell a bit easier what is being repeated by what?




screen 9
line (0,0)-(100,100)