§ Программа на QBasic
SCREEN 13
DIM SHARED wp(320) AS SINGLE
DIM SHARED wn(320) AS SINGLE
DIM SHARED bt(320) AS INTEGER
FOR i = 0 TO 319: wp(i) = 0: NEXT
Atmo
DO
k$ = INKEY$
IF k$ = " " OR id > nx THEN
FOR i = 0 TO 4
x = INT(RND * 320)
wp(x) = wp(x) - 8 * RND
NEXT
id = 0
nx = INT(RND * 25 + 15)
END IF
Update
id = id + 1
LOOP UNTIL k$ = CHR$(27)
SUB Atmo
RANDOMIZE TIMER
LINE (0, 0)-(320, 100), 1, BF
CIRCLE (300, 20), 13, 14: PAINT (300, 20), 14
FOR x = 0 TO 320: bt(x) = 200: NEXT
FOR x = 0 TO 128
h = INT(x ^ 2 / 128)
s = 150 + h
bt(x) = s
FOR y = s TO 199
l = y - 149
IF RND > l / 75 THEN cl = 14 ELSE cl = 6
PSET (x, y), cl
NEXT
NEXT
END SUB
SUB Update
omega = .995
relax = .995
FOR i = 0 TO 319
IF i = 0 THEN a = wn(1) ELSE a = wn(i - 1)
IF i = 319 THEN b = wn(318) ELSE b = wn(i + 1)
laplas = (a + b) / 2
wp(i) = laplas + omega * (wn(i) - wp(i))
wp(i) = wp(i) * relax
NEXT
WU = 100
WL = 170
FOR i = 0 TO 319
SWAP wp(i), wn(i)
lv = WL - INT(wn(i))
IF lv <= bt(i) THEN
LINE (i, WU)-(i, lv - 2), 1
LINE (i, lv)-(i, bt(i)), 3
nx = wn(i + 1) - wn(i)
IF nx < 0 THEN cl = 15 ELSE cl = 11
PSET (i, lv - 1), cl
ELSE
LINE (i, WU)-(i, bt(i)), 1
END IF
NEXT
END SUB