0% found this document useful (0 votes)
7 views1 page

Pascal Fireworks Animation Code

This Pascal code defines procedures to: 1) Write characters to the screen at specified coordinates and delay for a specified time in milliseconds. 2) Draw falling bars of random heights from top to bottom of the screen. 3) Draw a phao pattern around a central point by writing characters in an expanding square pattern. 4) The main code uses these procedures to repeatedly draw and erase random phao patterns until a key is pressed.

Uploaded by

Nhật Huy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Pascal Fireworks Animation Code

This Pascal code defines procedures to: 1) Write characters to the screen at specified coordinates and delay for a specified time in milliseconds. 2) Draw falling bars of random heights from top to bottom of the screen. 3) Draw a phao pattern around a central point by writing characters in an expanding square pattern. 4) The main code uses these procedures to repeatedly draw and erase random phao patterns until a key is pressed.

Uploaded by

Nhật Huy
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

CODE PhaoXuan.

PAS
uses crt; const d:array[1..5]of char=(#219,#4,#178,#177,#176); var x:byte;z:1..5;a,b,c,r:byte; procedure writexy(x,y:byte;c:char); begin gotoxy(x,y); write(c); end; Procedure Delay(ms:word); var i,j:word; begin for i:=1 to ms do for j:=1 to 18000 do; end; procedure ban; var f:byte; begin for f:=1 to a do begin writexy(f,26-round(f*b/a+1),#4); delay(500); writexy(f,26-round(f*b/a+1),#32); end; end; procedure phao(x,y,z:byte;c:char); begin writexy(x-z*2,y-z,c); writexy(x+z*2,y-z,c); writexy(x-z*2,y+z,c); writexy(x+z*2,y+z,c); writexy(x-z*2-2,y,c); writexy(x+z*2+2,y,c); writexy(x,y-z-2,c); writexy(x,y+z+2,c); gotoxy(1,1); {cap nhat cua net9_thp} end; BEGIN clrscr; repeat a:=random(50)+15; b:=random(10)+10; textcolor(random(7)+8); z:=random(4)+1; ban; for c:=1 to z do begin phao(a,b,c,d[c]); delay(2000); end; for c:=1 to z do begin phao(a,b,c,#32); delay(2000); end; until keypressed; readln; end.

You might also like