LOOP.BAS

Go back

Below you'll find the source for the QBasic file LOOP.BAS.

I've been in doubt if I'd republish this file again. Mainly for a few reasons;
1. The stuff I made as a kid is very childish (which kinda makes sense)
2. Times have changed; what was funny/innovative or sharable in 1997 doesn't meet standards in 2023.
3. Most of the code doesn't run natively anymore on modern operating systems.
4. It's in the Dutch language, where most of my shared content is in English.

Still, I've decided to share this file. Keep in mind the age of this content though.

``````'Declaratie van de functie Kleur
DECLARE FUNCTION Kleur! (blauw!, groen!, rood!)

'Foutmeldingen aan en gaat naar grafisch beeld
ON ERROR GOTO fout1
SCREEN 12
ON ERROR GOTO fout2

'Maakt het beeld op
CONST aan = -1, uit = 0
'Hier kunt u kiezen tussen uit (=0) en aan (=-1)
strobos = aan: disco = aan: loopef = aan
FOR a = 0 TO 15: PALETTE a, Kleur(a, a * 3, a * 4): NEXT a
IF strobos THEN CIRCLE (320, 240), 180, 15: PAINT (320, 240), 15
IF disco THEN LINE (320, 240)-(320, 0), 15: LINE (320, 240)-(640, 480), 15: LINE (320, 240)-(0, 480), 15
IF disco THEN PAINT (1, 1), 14, 15: PAINT (639, 1), 13, 15: PAINT (319, 479), 12, 15
IF loopef THEN
FOR gr = 0 TO 360
c = c + 1: IF c > 11 THEN c = c - 11
DRAW "TA" + STR\$(gr) + "BM320,240" + "BU210" + "C" + STR\$(c) + "U10R10D10L10BU5BR2P" + STR\$(c) + "," + STR\$(c)
DRAW "TA" + STR\$(360 - gr) + "BM320,240" + "BU200" + "C" + STR\$(c) + "U10R10D10L10BU5BR2P" + STR\$(c) + "," + STR\$(c)
NEXT gr
END IF
FOR a = 0 TO 15: PALETTE a, 0: NEXT a

'Lichteffecten
DO
c = c + 1: IF c > 11 THEN c = 1
d = c + 1: IF d > 11 THEN d = 1
e = d + 1: IF e > 11 THEN e = 1
f = e + 1: IF f > 11 THEN f = 1
g = INT(RND * 3) + 12: j = g - 11
PALETTE 15, Kleur(0, 0, 0): PALETTE d, Kleur(63, 0, 0)
PALETTE e, Kleur(0, 63, 0): PALETTE f, Kleur(0, 0, 63)
PALETTE c, Kleur(0, 0, 0): PALETTE 15, Kleur(63, 63, 63)
IF j = 1 THEN PALETTE g, Kleur(63, 0, 0)
IF j = 2 THEN PALETTE g, Kleur(0, 63, 0)
IF j = 3 THEN PALETTE g, Kleur(0, 0, 63)
PALETTE og, 0: og = g
LOOP WHILE INKEY\$ = ""

'Einde van de demo (gaat terug naar DOS-scherm)
SCREEN 0
WIDTH 80, 25
PRINT "This demo is made by:"
PRINT , , "Stefan Thoolen"
PRINT , , "-Address removed-"
PRINT , , "48** **  Breda"
PRINT , , "The Netherlands"
SYSTEM

'Foutmeldingen
fout1: PRINT "Uw monitor is niet goed; dit vereist een VGA monitor (SCREEN 12)": SYSTEM
fout2: PRINT "Onverwachte fout nr."; ERR; "gevonden": SYSTEM

FUNCTION Kleur (blauw, groen, rood)
Kleur = 65536 * blauw + 256 * groen + rood
END FUNCTION

``````