1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
| uses crt;
TYPE neige=record
x,y:integer;
i:byte;
end;
var vitesse,b,v:integer;
depla:array[1..10000]of neige;
procedure parametre;
begin
asm
mov ax, 03h
int 10h
end;
WRITEln('vitesse? (10:trŠs rapide, 20:rapide, 30:moyen, 40:lent...');
READln(vitesse);
writeln('baromŠtre? (500:petite chutte, 1000:tempˆte, 2000:blizzar...');
readln(b);
writeln('vent de c“t‚?: (1:faible, 2:moyen, 3:‚lev‚...');
readln(v);
end;
procedure position(x,y:integer;i:byte);
begin
mem[$a000:x+y*320]:=i;
end;
procedure setcolor(i,r,g,b:byte);
begin
port[$3c8]:=i;
port[$3c9]:=r;
port[$3c9]:=g;
port[$3c9]:=b;
end;
procedure assigncolor;
var j:integer;
begin
for j:=1 to 240 do setcolor(j,j,j,j);
for j:=1 TO b do with depla[j] do
begin
x:=random(320);
y:=random(200);
i:=random(250);
position(x,y,i);
end;
end;
procedure deplace;
var j:integer;
begin
for j:= 1 TO b DO WITH depla[j] DO
begin
position(x,y,0);
if i<50 THEN
BEGIN
y:=y+1;
x:=x+v;
end
else
if i<100 THEN
BEGIN
Y:=Y+2;
x:=x+v;
end
else
if i<150 THEN
begin
Y:=Y+3;
x:=x+v;
end
else
if i<200 THEN
begin
Y:=Y+4;
x:=x+v+1;
end
else
begin
y:=y+5;
x:=x+v+1;
END;
if y> 199 THEN inc(y,0);
Position(x,y,I);
end;
end;
begin
parametre;
asm
mov ax, 13h
int 10h
end;
RANDOMIZE;
assigncolor;
repeat
deplace;
delay(vitesse);
until keypressed;
end. |
Partager