home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Rat's Nest 1
/
ratsnest1.iso
/
incoming
/
pas_sors.arj
/
KRU$H04.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-12-26
|
7KB
|
226 lines
program Nice_Lines;
{ Hello again... }
{ This is version 0.10ß of Nice_Lines. It contains }
{ some very simple graphics routines using the Sine }
{ and the Cosine waves and normal lines. I repeat, }
{ it's nothing special, and will only be of help to }
{ beginners. You may modify this program as long as }
{ you don't distribute it after it has been modified. }
{ - Kru$H -95 }
{ ps. I think there might be more comments then code }
{ in this program/source/piece_of_shit, but what }
{ the hell. }
{ If your pet snake kills you because you have used }
{ used this program, or if a piano lands on you in the }
{ middle of an open field, don't blame me. }
uses crt, graph, dos;
var c, x, y, x1, y1 : integer;
gM, gT, i, i2 : integer;
a,b : real;
Type DacPalette256 = array[0..255] of array[0..2] of Byte;
Const
SVGA320x200x256 = 0; { 320x200x256 Standard VGA }
SVGA640x400x256 = 1; { 640x400x256 Svga }
SVGA640x480x256 = 2; { 640x480x256 Svga }
SVGA800x600x256 = 3; { 800x600x256 Svga }
SVGA1024x768x256 = 4; { 1024x768x256 Svga }
TRANS_COPY_PIX = 8;
procedure SetVGAPalette256(PalBuf : DacPalette256);
var
Reg : Registers;
begin
reg.ax := $1012;
reg.bx := 0;
reg.cx := 256;
reg.es := Seg(PalBuf);
reg.dx := Ofs(PalBuf);
intr($10,reg);
end;
procedure graphic_stuff;
begin
gM := InstallUserDriver ('SVGA256',nil);
gT := 3;
InitGraph (gM, gT, 'c:\tp'); { I hate this line, why can't tp }
setcolor(15); { just find the damn BGI file? }
randomize;
end;
procedure nice_lines1; { What happened to the blonde }
begin { skydiver ? }
x:=0 ; y:=0 ; x1:=0 ; y1:=getmaxy; { - She missed the earth. }
for i:=0 to 5 do begin
for c:=32 to 65 do begin { How does a blonde punctuate }
Setcolor(c); { 'FUN FUN FUN WORRY WORRY WORRY' }
line(x,y,x1,y1); { - fun PERIOD fun PERIOD fun }
inc( y,6); { NO PERIOD worry worry worry }
inc(x1,8);
end;
end;
x:=0 ; y:=0 ; x1:=getmaxx ; y1:=0;
for i:=0 to 5 do begin
For c:=65 downto 32 do begin
Setcolor(c);
line(x,y,x1,y1);
inc(x,8);
inc(y1,6);
end;
end;
SetTextJustify(1,1);
Setcolor(35); OutTextXY(400,265,'The following Demonstration');
SetColor(36); OutTextXY(400,280,'of Sine and Cosine waves');
Setcolor(38); OutTextXY(400,295,'brought to you by:');
SetColor(40); OutTextXY(400,310,'Kru$H');
readkey;
end;
procedure halfway_house;
begin
setcolor(14);
x:=0 ; y:=0 ; x1:=0 ; y1:=getmaxy; { This could probably easily }
for i:=0 to 100 do begin { be shortened by making a }
line(x,y,x1,y1); { different procedure for the }
inc( y,6); { loop, but I'm too lazy to }
inc(x1,8); { bother about it. }
end; { Why don't you try to fix it. }
x:=0 ; y:=600 ; x1:=800 ; y1:=600;
for i:=0 to 100 do begin
line(x,y,x1,y1);
inc( x,8);
dec(y1,6);
end;
x:=0 ; y:=0 ; x1:=getmaxx ; y1:=0;
for i:=0 to 100 do begin
line(x,y,x1,y1);
inc( x,8);
inc(y1,6);
end;
x:=800 ; y:=0; x1:=0; y1:=0;
for i:=0 to 100 do begin
line(x,y,x1,y1);
dec( x,8);
inc(y1,6);
end;
readkey;
end;
procedure nice_lines2;
begin
clearviewport;
SetLineStyle(0,0,3); { Ooh... What thick lines you have. ;) }
x:=0 ; y:= 200 ;
SetColor(37); OutTextXY(100,155,'Sin-curve');
Moveto(x,y);
for i:=0 to 3 do begin
for c:=32 to 65 do begin
Setcolor(c);
inc(x,6) ; y1:=y+round(20*sin(x)); { This is quite a weird thing. }
lineto(x,y1); { If you want to enlarge the }
end; { wave, you have to work out }
end; { the proper relationships. }
SetColor(39); OuttextXY(100,355,'Cos-curve');
x:=0 ; y:= 400;
moveto(x,y);
for i:=0 to 3 do begin
for c:=32 to 65 do begin
SetColor(c);
inc(x,6); y1:=y+round(20*cos(x)); { And here it is again... }
lineto(x,y1);
end;
end;
readkey;
end;
procedure nice_lines3; { Why were a blonde couple found frozen }
begin { at a drive-in movie in the spring ? }
ClearViewPort; { - They went to see 'Closed for the Winter' }
SetLineStyle(0,0,2);
y:= 30 ; SetColor(37);
for i:=0 to 3 do begin
for c:=32 to 55 do begin
x:=0; moveto(x,y);
for i2:=0 to 134 do begin
Setcolor(c);
inc(x,6) ; y1:=y+round(20*sin(x));
lineto(x,y1);
end;
inc(y,3); x:=0; { What is the difference between a chorus }
end; { line of blondes and a magician ? }
end; readkey; { - A magician has a cunning array of stunts.. }
end;
procedure nice_lines4;
procedure line_it(q,w :integer);
begin
for i2:=0 to 50 do begin
x:=0; moveto(x,y);
for i:=0 to 7 do begin
for c:=q to w do begin
Setcolor(c);
inc(x,6) ; y1:=y+round(20*sin(x));
lineto(x,y1);
end;
for c:=w downto q do begin
SetColor(c);
inc(x,6) ; y1:=y+round(20*sin(x));
lineto(x,y1);
end;
end; inc(y,1);
end;
end;
begin
ClearViewPort;
SetLineStyle(0,0,0);
y:=50 ; Line_IT(32,40); { Here I actually bothered making a }
inc(y,10); Line_IT(41,49); { seperate procedure for the loops }
inc(y,12); Line_IT(36,44);
inc(y,15); Line_IT(23,31);
inc(y,19); Line_IT(16,24);
readkey;
end;
procedure The_End;
begin
ClearViewPort; SetColor(yellow); SettextJustify(1,1);
OutTextXY(400,250,'Have a nice day');
delay(600);
for i:=0 to MaxInt do begin
PutPixel(330+random(140),240+random(20),0);
end;
end;
begin { Ta-Daa... The Main Program ! }
graphic_stuff;
nice_lines1; { Why were all the blondes found on }
halfway_house; { the roof of a house after a party ? }
nice_lines2; { - Someone had told them that the }
nice_lines3; { drinks were on the house. }
nice_lines4;
the_end; { The fuck stops here ;) }
CloseGraph;
end. { Hope you enjoyed this crap ! }