I teach Computer-assisted writing at a community college and for several years I have been writing my own curricula. Students like things that are a bit eye-catching to start them off and add a bit of pizazz to a library skills exercise, for instance.
My skill in programming QBasic and Quickbasic comes mainly from the book lang.basic.misc when I have bogged down. I thought that my title for exercises would be more interesting if it moved in some way. I saw some circles that grew by the STEP procedure in and I thought that they would make an interesting title screen, if only I could get several of them to advance across the screen and to overlap in some way.
Of course, I thought of a FOR LOOP. I made several attempts at launching circles up the screen, moving from bottom to top, in a FOR sequence. I had a problem getting my circles to advance, as I recall, and they simply overwrote each other. So after several tries, I asked if anyone on our Basic newsgroup had a way to make circles go up the screen. This is what Don Schullian sent me from last April on our comp.lang.basic.misc group:
'==============Don's Subroutine that worked for circling=================
'
'From: Don Schullian
SCREEN 9: CLS
MyColors:
DATA 01, 320
DATA 01, 320
DATA 09, 310
DATA 02, 310
DATA 02, 310
DATA 14, 310
DATA 0
RESTORE MyColors
x% = 320
Y% = 300
DO
READ Colour%
IF Colour% = 0 THEN END
READ x%
FOR Radius% = 1 TO 300 STEP 3
CIRCLE (x%, Y%), Radius%, Colour%
NEXT Radius%
Y% = Y% + 10
LOOP
I finally got the idea from Don's FOR radius% statement how to make the circles dance up the screen. I realized that I had been locked into a "Duh!" moment, but vowed that I would do something truly interesting with the routine and you can be the judge of that.
Instead of just moving up the screen, I decided to make my circles go around the border of the screen in a counterclockwise fashion. The direction just happened and I never consciously thought of it. Anyone can reverse the order of the advancing circles. Here is a sample of a title screen for one of my class exercises:
' ================== GLORIA'S TITLE SCREEN ======================
'
' Apologies to whomever who showed how to place circles into a
' SUB statement.
'
DECLARE SUB DrawCircle (x!, Y!, colr!)
SCREEN 9
CALL DrawCircle(320, 8, 3)
CALL DrawCircle(260, 8, 2)
CALL DrawCircle(210, 8, 1)
CALL DrawCircle(160, 8, 15)
CALL DrawCircle(110, 8, 14)
CALL DrawCircle(60, 8, 13)
CALL DrawCircle(10, 8, 12)
CALL DrawCircle(10, 88, 11)
CALL DrawCircle(10, 138, 3)
CALL DrawCircle(10, 188, 2)
CALL DrawCircle(10, 238, 1)
CALL DrawCircle(10, 388, 2)
CALL DrawCircle(70, 438, 1)
CALL DrawCircle(130, 438, 15)
CALL DrawCircle(200, 438, 14)
CALL DrawCircle(270, 438, 13)
CALL DrawCircle(340, 438, 12)
CALL DrawCircle(400, 438, 11)
CALL DrawCircle(670, 338, 10)
CALL DrawCircle(670, 238, 1)
CALL DrawCircle(670, 138, 2)
CALL DrawCircle(670, 38, 3)
LINE (80, 20)-(550, 330), 0, BF
' I adapted this routine from a book of samples of
' enlarged letters, via multiples of X and Y values.
DEFINT X-Y
COLOR 8
LOCATE 25, 1
PRINT " Hi, World!";
FOR Y = 0 TO 11
Y2 = 2 *
Y: Y3 = 3 * Y: Y4 = 4 * Y
FOR x =
0 TO 94
Z = POINT(x, 349 - Y)
IF Z <> 0 THEN
X2 = 2 * x: X3 = 3 * x
' Chubby rounded font
CIRCLE (150 + X3, 200 - Y4), 3, 10
END IF
NEXT
NEXT
LOCATE 17, 25
COLOR 11
PRINT "shareware Gloria McMillan 1999"
SLEEP 1
LOCATE 20, 27
COLOR 2
PRINT "THIS WOULD START A PROGRAM."
F$ = INPUT$(1)
CLS
DEFSNG X-Y
DEFINT X-Y
SUB DrawCircle (x!, Y!, colr!)
COLOR colr
FOR radius = 1 TO 300 STEP 3
CIRCLE (x, Y), radius
NEXT radius
END SUB