'=========================================================================== ' Subject: FALLING SNOW SIMULATION Date: 05-30-96 (17:44) ' Author: Fred Fortin Code: QB, QBasic, PDS ' Origin: fortin@accent.net Packet: GRAPHICS.ABC '=========================================================================== DECLARE SUB GRAPHX () DIM X(1000): DIM Y(1000): DIM STYLE(1000): DIM Z(1000): DIM SOLX(1000): DIM SOLY(1000) FLOCONS = 50: C = 15: TOTAL = 10: ZZ = 1 SCREEN 13 GRAPHX LINE (1, 189)-(319, 189), 15 TOTAL = INT(RND * 19 + 1) FOR A = 1 TO FLOCONS RANDOMIZE TIMER X(A) = INT(RND * 318 + 1) Y(A) = INT(RND * 177 + 3) Z(A) = 1 STYLE(A) = INT(RND * 2 + 1) IF STYLE(A) = 0 THEN STYLE(A) = 1 SOLY(A) = 189 NEXT A A = 1 DO PSET (X(A), Y(A)), C: PSET (X(A), Y(A)), 0 IF Z(A) = TOTAL THEN GOSUB TEST IF Z(A) > 10 THEN GOSUB TEST IF STYLE(A) = 1 THEN X(A) = X(A) - 1: Y(A) = Y(A) + 1 IF STYLE(A) = 2 THEN X(A) = X(A) + 1: Y(A) = Y(A) + 1 PSET (X(A), Y(A)), C GOSUB DEPOSE Z(A) = Z(A) + 1 A = A + 1 IF A = FLOCONS + 1 THEN A = 1 IF INKEY$ <> "" THEN END IF Y(A) = 1 OR Y(A) = 2 THEN LINE (1, 1)-(319, 2), BF LOOP TEST: IF STYLE(A) = 1 THEN STYLE(A) = 2: Z(A) = 1: RETURN IF STYLE(A) = 2 THEN STYLE(A) = 1: Z(A) = 1: RETURN RETURN DEPOSE: IF POINT(X(A), Y(A) + 1) <> 0 THEN X(A) = INT(RND * 318 + 1): Y(A) = 1: PSET (X(A), Y(A)), C RETURN SUB GRAPHX STATIC LINE (140, 80)-(180, 180), 2 LINE (140, 80)-(100, 180), 2 LINE (100, 180)-(180, 180), 2 PAINT (150, 130), 2, 2 LINE (100, 160)-(125, 140), 0 LINE (110, 130)-(132, 120), 0 LINE (180, 160)-(155, 140), 0 LINE (190, 130)-(148, 120), 0 LINE (130, 181)-(150, 189), 6, BF END SUB