AKB Forums

Go Back   AKB Forums > Technical sections > Algorithms
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Algorithms The source of algorithms for your project

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Feb 15, 2002, 21:12   #1
Младенец
 
Join Date: Oct 2001
Location: Yerevan
Posts: 41
Rep Power: 0
Reputation: 10
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
SMoKE is offline   Reply With Quote Quote selected
Old Feb 17, 2002, 11:17   #2
Студент
 
Join Date: Jan 2002
Location: Zimbabwe
Posts: 268
Rep Power: 7
Reputation: 10
Send a message via ICQ to A.V.
Post

tozhe krasivo no flag mne bolee ponravilsya <img src="smooch-1.gif" border="0">
__________________
Things will never be the same again....
A.V. is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 08:51.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link