Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters > Algorithms
Register

Reply
 
LinkBack Thread Tools
Old 15.02.2002, 22:12   #1
Младенец
 
Join Date: 10 2001
Location: Yerevan
Posts: 55
Downloads: 7
Uploads: 0
Reputation: 8 | 0
Post Snow effect

Program Snow;
const
Flakes = 500; { mec = shat patilner (3000)}
Fastest = 1000; { poqr tiv=dandax patilner (240)}
Explosion = False;
Type FlakeyRec = Record x,y:Byte;
p:Word;
end;
var i:longint;
r,CurFlake,s,pf:Word;
Flake:Array[0..Flakes] of Flakeyrec;

Procedure vidMode(mode : byte);assembler;
asm
mov ah,$00;
mov al,mode;
int 10h;
end;

Function KeyPressed:boolean;assembler;
asm
mov ax,0100h;
int 16h;
jnz @1;
xor ax,ax;
ret;
@1:
inc ax;
end;

Procedure Perturb;assembler;
asm
mov dx,r;
xor dx,0AA55h;
shl dx,1;
adc dx,118h;
mov r,dx;
end;

Procedure Delay(CX1,DX2:WORD);Assembler;
asm
mov ah, 86h
mov cx, CX1
mov dx, DX2
int 15h
end;

Procedure GotoXY(x,y:integer; Str:String);
var i:integer;
begin
for i:=1 to y do
writeln;
for i:=1 to x do
write(' ');
write(str);
end;

Procedure SnowFall;
begin
GotoXY(13,11,'SMoKE in 2001');
Delay($F,$4240);
repeat
for CurFlake:= 1 to flakes do
with Flake[CurFlake] do
begin
Perturb;
Mem[$A000]:=0;
If x>=lo(r) then
Inc(p);
If y>=Hi(r) then
Inc(p,320);
Mem[$A000]:=y SHR 5 + $18;
end;
Repeat Until (port[$3DA] and $08) = $08;
until keypressed;
end;

Begin
for CurFlake:=0 to Flakes do
with Flake[curflake] do
begin
Perturb;
inc(s,r);
y:=Hi(Hi(r)*Fastest)+5;
x:=Hi(Lo(r)*y)+1;
If explosion = False then
p:=s;
end;
vidMode($13);
SnowFall;
vidMode($03);
end.
__________________
http://freenet.am/~softland
Reply With Quote
Old 17.02.2002, 12:17   #2
Студент
 
Join Date: 01 2002
Location: Zimbabwe
Posts: 268
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

tozhe krasivo no flag mne bolee ponravilsya <img src="smooch-1.gif" border="0">
Reply With Quote
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 07:35.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.