home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 September
/
Chip_1999-09_cd.bin
/
internet
/
Jeremy
/
tp
/
downloads
/
snowfall.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-08-03
|
1KB
|
51 lines
Program SnowFall;
Uses crt;
const
Flakes = 100;
Procedure vidMode(mode : byte);assembler;
asm mov ah,$00; mov al,mode; int 10h; end;
Procedure setPixel(pixPos : word; color : byte);
begin
mem[$A000:pixPos] := color;
end;
var
CurFlake : integer;
i : longint;
x,y, newPos: array[0..Flakes] of word;
BEGIN
randomize;
for curFlake:=0 to Flakes do
begin
x[curFlake]:=random(319);
y[curFlake]:=random(199);
end;
vidMode($13);
i := 0;
repeat
inc(i);
for curFlake:=0 to Flakes do
begin
setPixel(newPos[curFlake], 0);
newPos[curFlake] :=
round(x[curFlake]*(i*0.01)) +
round(y[curFlake]*(i*0.01)) * 320;
setPixel(newPos[curFlake], (curFlake mod 13) + 19);
end;
while (port[$3da] and $08) = $08 do;
while (port[$3da] and $08) = $00 do;
until keypressed;
vidMode($03);
end.