| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046 |
- USES Graph,CRT;
- CONST
- Resolution = 70;
- TYPE
- Point3D = Record
- X,Y : Real;
- End;
- Type Poly = record
- X,Y : Real;
- Ang : Real;
- NumPoints : byte;
- points : array [0..15] of Point3D;
- Color : byte;
- End;
- VAR CtrlPt: Array [-1..7] Of Point3D;
- RotatePt : Array [-1..7] Of Point3D;
- Cube : Poly;
- Procedure ShowObj(inp : Poly);
- Var X1,Y1,X2,Y2 : Real; i : integer;
- Begin
- X1 := inp.Points[0].X*cos(inp.Ang*3.14/180)-inp.Points[0].Y*sin(inp.Ang*3.14/180);
- Y1 := inp.Points[0].X*sin(inp.Ang*3.14/180)+inp.Points[0].Y*cos(inp.Ang*3.14/180);
- MoveTo(round(X1+Inp.X),round(Inp.Y-Y1));
- SetColor(inp.color);
- for i := 1 to inp.NumPoints-1 do
- begin
- X2 := inp.Points[i].X*cos(inp.Ang*3.14/180)-inp.Points[i].Y*sin(inp.Ang*3.14/180);
- Y2 := inp.Points[i].X*sin(inp.Ang*3.14/180)+inp.Points[i].Y*cos(inp.Ang*3.14/180);
- LineTo(round(X2+Inp.X),round(Inp.Y-Y2));
- end;
- X1 := inp.Points[0].X*cos(inp.Ang*3.14/180)-inp.Points[0].Y*sin(inp.Ang*3.14/180);
- Y1 := inp.Points[0].X*sin(inp.Ang*3.14/180)+inp.Points[0].Y*cos(inp.Ang*3.14/180);
- LineTo(round(X1+Inp.X),round(Inp.Y-Y1));
- End;{ShowCube}
- {--------------------------------------}
- PROCEDURE Spline_Calc (Ap, Bp, Cp, Dp: Point3D; T, D: Real; Var X, Y: Real);
- VAR T2, T3: Real;
- BEGIN
- T2 := T * T; { Square of t }
- T3 := T2 * T; { Cube of t }
- X := ((Ap.X*T3) + (Bp.X*T2) + (Cp.X*T) + Dp.X)/D; { Calc x value }
- Y := ((Ap.Y*T3) + (Bp.Y*T2) + (Cp.Y*T) + Dp.Y)/D; { Calc y value }
- END;
- PROCEDURE BSpline_ComputeCoeffs (N: Integer; Var Ap, Bp, Cp, Dp: Point3D);
- BEGIN
- Ap.X := -CtrlPt[N-1].X + 3*CtrlPt[N].X - 3*CtrlPt[N+1].X + CtrlPt[N+2].X;
- Bp.X := 3*CtrlPt[N-1].X - 6*CtrlPt[N].X + 3*CtrlPt[N+1].X;
- Cp.X := -3*CtrlPt[N-1].X + 3*CtrlPt[N+1].X;
- Dp.X := CtrlPt[N-1].X + 4*CtrlPt[N].X + CtrlPt[N+1].X;
- Ap.Y := -CtrlPt[N-1].Y + 3*CtrlPt[N].Y - 3*CtrlPt[N+1].Y + CtrlPt[N+2].Y;
- Bp.Y := 3*CtrlPt[N-1].Y - 6*CtrlPt[N].Y + 3*CtrlPt[N+1].Y;
- Cp.Y := -3*CtrlPt[N-1].Y + 3*CtrlPt[N+1].Y;
- Dp.Y := CtrlPt[N-1].Y + 4*CtrlPt[N].Y + CtrlPt[N+1].Y;
- END;
- {--------------------------------------}
- PROCEDURE Rotate_ComputeCoeffs (N: Integer; Var Ap, Bp, Cp, Dp: Point3D);
- BEGIN
- Ap.X := -RotatePt[N-1].X + 3*RotatePt[N].X - 3*RotatePt[N+1].X + RotatePt[N+2].X;
- Ap.Y := -RotatePt[N-1].Y + 3*RotatePt[N].Y - 3*RotatePt[N+1].Y + RotatePt[N+2].Y;
- Bp.X := 3*RotatePt[N-1].X - 6*RotatePt[N].X + 3*RotatePt[N+1].X;
- Bp.Y := 3*RotatePt[N-1].Y - 6*RotatePt[N].Y + 3*RotatePt[N+1].Y;
- Cp.X := -3*RotatePt[N-1].X + 3*RotatePt[N+1].X;
- Cp.Y := -3*RotatePt[N-1].Y + 3*RotatePt[N+1].Y;
- Dp.X := RotatePt[N-1].X + 4*RotatePt[N].X + RotatePt[N+1].X;
- Dp.Y := RotatePt[N-1].Y + 4*RotatePt[N].Y + RotatePt[N+1].Y;
- END;
- {--------------------------------------}
- PROCEDURE BSpline (X1,Y1,X2,Y2:ReAL;o:poly);
- VAR I, J: Integer; X, Y, Lx, Ly,A1,A2: Real; Ap, Bp, Cp, Dp: Point3D;
- A, B, C, D: Point3D;
- BEGIN
- CtrlPt[1].X := X1; CtrlPt[1].Y := Y1;
- CtrlPt[5].X := X2; CtrlPt[5].Y := Y2;
- CtrlPt[2].X := Random(640); CtrlPt[2].Y := Random(480);
- CtrlPt[3].X := Random(640); CtrlPt[3].Y := Random(480);
- CtrlPt[4].X := Random(640); CtrlPt[4].Y := Random(480);
- RotatePt[1].X := 0; RotatePt[1].Y := 0;
- RotatePt[5].X := 360; RotatePt[5].Y := 360;
- RotatePt[2].X := Random(360); RotatePt[2].Y := Random(360);
- RotatePt[3].X := Random(360); RotatePt[3].Y := Random(360);
- RotatePt[4].X := Random(360); RotatePt[4].Y := Random(360);
- CtrlPt[-1] := CtrlPt[1];
- CtrlPt[0] := CtrlPt[1];
- CtrlPt[6] := CtrlPt[5];
- CtrlPt[7] := CtrlPt[5];
- RotatePt[-1] := RotatePt[1];
- RotatePt[0] := RotatePt[1];
- RotatePt[6] := RotatePt[5];
- RotatePt[7] := RotatePt[5];
- For I := 0 To 5 Do Begin
- BSpline_ComputeCoeffs(I, Ap, Bp, Cp, Dp);
- Rotate_ComputeCoeffs(I, A, B, C, D);
- For J := 1 To Resolution Do Begin
- Spline_Calc(Ap, Bp, Cp, Dp, J/Resolution, 6, X, Y);
- Spline_Calc(A, B, C, D,J/Resolution , 6, A1,A2);
- o.Ang := round(A1) mod 360;
- o.X := X;
- o.Y := Y;
- ShowObj(o);
- Delay(2500 div Resolution);
- ShowObj(o);
- End;
- If KeyPressed then
- Begin
- ReadKey;
- o.Ang := 0;
- o.X := X2;
- o.Y := Y2;
- ShowObj(o);
- Exit;
- End;
- End;
- ShowObj(o);
- END;
- {--------------------------------------}
- Procedure InitObj;
- Begin
- with Cube do begin
- NumPoints := 5;
- Color := Green;
- Points[0].X := -10;
- Points[0].Y := -5;
- Points[1].X := 10;
- Points[1].Y := -5;
- Points[2].X := 10;
- Points[2].Y := 15;
- Points[3].X := 10;
- Points[3].Y := 5;
- Points[4].X := -10;
- Points[4].Y := 15;
- Ang := 0;
- X := 320;
- y := 200;
- End;
- End;{InitObj}
- {-------------------------------------}
- Procedure _A(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 7;
- Points[0].X := -15; Points[0].Y := -15;
- Points[2].X := -5; Points[2].Y := -5;
- Points[3].X := 5; Points[3].Y := -5;
- Points[4].X := 5; Points[4].Y := -15;
- Points[5].X := 15; Points[5].Y := -15;
- Points[6].X := 0; Points[6].Y := 25;
- Points[1].X :=-5 ; Points[1].Y := -15;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 3;
- Points[0].X := -5; Points[0].Y := -5;
- Points[2].X := 0; Points[2].Y := 5;
- Points[1].X := 5 ; Points[1].Y := -5;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70+5,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{A}
- {--------------------}
- Procedure _B(posX,posY : byte);
- Var _1,_2,_3:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 9;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X :=5 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -15;
- Points[3].X := 15; Points[3].Y := -10;
- Points[4].X := 5; Points[4].Y := 0;
- Points[5].X := 15; Points[5].Y := 5;
- Points[6].X := 15; Points[6].Y := 15;
- Points[7].X := 5; Points[7].Y := 20;
- Points[8].X := -15; Points[8].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := -15;
- Points[1].X := 5 ; Points[1].Y := -15;
- Points[2].X := 5; Points[2].Y := -5;
- Points[3].X := -5 ; Points[3].Y := -5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _3 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := 5;
- Points[1].X := 5 ; Points[1].Y := 5;
- Points[2].X := 5; Points[2].Y := 15;
- Points[3].X := -5 ; Points[3].Y := 15;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40-2,posY*70,_2);
- BSpline(Random(640),480,20+posX*40-2,posY*70,_3);
- End;{B}
- {--------------------}
- Procedure _C(posX,posY : byte);
- Var _1,_2,_3:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 6;
- Points[0].X := -5; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := 10; Points[3].Y := -5;
- Points[4].X := 5; Points[4].Y := -10;
- Points[5].X := -15; Points[5].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y := -10;
- Points[1].X := -8 ; Points[1].Y := -10;
- Points[2].X := -8; Points[2].Y := 10;
- Points[3].X := -15 ; Points[3].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _3 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y := 10;
- Points[1].X := 5 ; Points[1].Y := 10;
- Points[2].X := 10; Points[2].Y := 5;
- Points[3].X := 15 ; Points[3].Y := 10;
- Points[4].X := 5 ; Points[4].Y := 20;
- Points[5].X := -5 ; Points[5].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- BSpline(Random(640),480,20+posX*40,posY*70,_3);
- End;{C}
- {--------------------}
- Procedure _D(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 7;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := 5; Points[2].Y := -15;
- Points[3].X := 15; Points[3].Y := 0;
- Points[4].X := 5; Points[4].Y := 15;
- Points[5].X := -5; Points[5].Y := 20;
- Points[6].X := -15; Points[6].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 3;
- Points[0].X := -5; Points[0].Y := -10;
- Points[2].X := 5; Points[2].Y := 0;
- Points[1].X := -5 ; Points[1].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{D}
- {--------------------}
- Procedure _E(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := 15 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := -5; Points[3].Y := -10;
- Points[4].X := -5; Points[4].Y := -5;
- Points[5].X := 0; Points[5].Y := -5;
- Points[6].X := 0; Points[6].Y := 5;
- Points[7].X := -15; Points[7].Y := 5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y := 5;
- Points[1].X := -5; Points[1].Y := 5;
- Points[2].X := -5 ; Points[2].Y := 10;
- Points[3].X := 15 ; Points[3].Y := 10;
- Points[4].X := 15 ; Points[4].Y := 20;
- Points[5].X := -15 ; Points[5].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{E}
- {--------------------}
- Procedure _F(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -5; Points[2].Y := -5;
- Points[3].X := 5; Points[3].Y := -5;
- Points[4].X := 5; Points[4].Y := 0;
- Points[5].X := -15; Points[5].Y := 0;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y := 0;
- Points[1].X := -5; Points[1].Y := 0;
- Points[2].X := -5 ; Points[2].Y := 10;
- Points[3].X := 15 ; Points[3].Y := 10;
- Points[4].X := 15 ; Points[4].Y := 20;
- Points[5].X := -15 ; Points[5].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{F}
- {--------------------}
- Procedure _G(posX,posY : byte);
- Var _1,_2,_3:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 9;
- Points[0].X := -5; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := 15; Points[3].Y := 0;
- Points[4].X := 0; Points[4].Y := 0;
- Points[5].X := 0; Points[5].Y := -5;
- Points[6].X := 5; Points[6].Y := -5;
- Points[7].X := 5; Points[7].Y := -10;
- Points[8].X := -15; Points[8].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y := -10;
- Points[1].X := -5 ; Points[1].Y := -10;
- Points[2].X := -5; Points[2].Y := 10;
- Points[3].X := -15 ; Points[3].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _3 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y := 10;
- Points[1].X := 5 ; Points[1].Y := 10;
- Points[2].X := 10; Points[2].Y := 5;
- Points[3].X := 15 ; Points[3].Y := 10;
- Points[4].X := 5 ; Points[4].Y := 20;
- Points[5].X := -5 ; Points[5].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- BSpline(Random(640),480,20+posX*40,posY*70,_3);
- End;{G}
- {--------------------}
- Procedure _H(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -5; Points[2].Y := -10;
- Points[3].X := 5; Points[3].Y := -10;
- Points[4].X := 5; Points[4].Y := 0;
- Points[5].X := -5; Points[5].Y := 0;
- Points[6].X := -5; Points[6].Y := 20;
- Points[7].X := -15; Points[7].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := 5; Points[0].Y := -20;
- Points[1].X := 15; Points[1].Y := -20;
- Points[2].X := 15 ; Points[2].Y := 20;
- Points[3].X := 5 ; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{H}
- {--------------------}
- Procedure _I(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := 15 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := 5; Points[3].Y := -10;
- Points[4].X := 5; Points[4].Y := 10;
- Points[5].X := -5; Points[5].Y := 10;
- Points[6].X := -5; Points[6].Y := -10;
- Points[7].X := -15; Points[7].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y := 10;
- Points[1].X := 15; Points[1].Y := 10;
- Points[2].X := 15 ; Points[2].Y := 20;
- Points[3].X := -15 ; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{I}
- {--------------------}
- Procedure _J(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 9;
- Points[0].X := -15; Points[0].Y := -10;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := 5; Points[2].Y := -20;
- Points[3].X := 15; Points[3].Y := -10;
- Points[4].X := 15; Points[4].Y := 0;
- Points[5].X := 5; Points[5].Y := 0;
- Points[6].X := 5; Points[6].Y := -10;
- Points[7].X := -5; Points[7].Y := -10;
- Points[8].X := -10; Points[8].Y := -5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := 5; Points[0].Y := 0;
- Points[1].X := 15; Points[1].Y := 0;
- Points[2].X := 15 ; Points[2].Y := 20;
- Points[3].X := -15 ; Points[3].Y := 20;
- Points[4].X := -15 ; Points[4].Y := 10;
- Points[5].X := 5 ; Points[5].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{J}
- {--------------------}
- Procedure _K(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -5; Points[2].Y := -5;
- Points[3].X := 0; Points[3].Y := -5;
- Points[4].X := 5; Points[4].Y := -20;
- Points[5].X := 15; Points[5].Y := -20;
- Points[6].X := 5; Points[6].Y := 0;
- Points[7].X := -15; Points[7].Y := 0;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y := 20;
- Points[1].X := -5 ; Points[1].Y := 20;
- Points[2].X := -5; Points[2].Y := 5;
- Points[3].X := 0; Points[3].Y := 5;
- Points[4].X := 5; Points[4].Y := 20;
- Points[5].X := 15; Points[5].Y := 20;
- Points[6].X := 5; Points[6].Y := 0;
- Points[7].X := -15; Points[7].Y := 0;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{K}
- {--------------------}
- Procedure _L(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := 15 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := -5; Points[3].Y := -10;
- Points[4].X := -5; Points[4].Y := 0;
- Points[5].X := -15; Points[5].Y := 0;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y :=0;
- Points[1].X := -5; Points[1].Y := 0;
- Points[2].X := -5 ; Points[2].Y := 20;
- Points[3].X := -15 ; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{L}
- {--------------------}
- Procedure _M(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 7;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -5; Points[2].Y := 10;
- Points[3].X := 0; Points[3].Y := -10;
- Points[4].X := 0; Points[4].Y := 10;
- Points[5].X := -5; Points[5].Y := 20;
- Points[6].X := -15; Points[6].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 7;
- Points[0].X := 15; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 5; Points[2].Y := 10;
- Points[3].X := 0; Points[3].Y := -10;
- Points[4].X := 0; Points[4].Y := 10;
- Points[5].X := 5; Points[5].Y := 20;
- Points[6].X := 15; Points[6].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{M}
- {--------------------}
- Procedure _N(posX,posY : byte);
- Var _1,_2,_3:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := 0;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 5; Points[2].Y := 0;
- Points[3].X := -5; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -5; Points[2].Y := 20;
- Points[3].X := -15 ; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _3 do begin
- NumPoints := 4;
- Points[0].X := 15; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 5; Points[2].Y := 20;
- Points[3].X := 15 ; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- BSpline(Random(640),480,20+posX*40,posY*70,_3);
- End;{N}
- {--------------------}
- Procedure _O(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := -5; Points[0].Y := -5;
- Points[1].X := 0 ; Points[1].Y := -10;
- Points[2].X := 5; Points[2].Y := -5;
- Points[3].X := 5; Points[3].Y := 5;
- Points[4].X := 0; Points[4].Y := 10;
- Points[5].X := -5; Points[5].Y := 5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y :=-10;
- Points[1].X := -5; Points[1].Y := -20;
- Points[2].X := 5 ; Points[2].Y := -20;
- Points[3].X := 15 ; Points[3].Y := -10;
- Points[4].X := 15; Points[4].Y :=10;
- Points[5].X := 5; Points[5].Y := 20;
- Points[6].X := -5 ; Points[6].Y := 20;
- Points[7].X := -15 ; Points[7].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{O}
- {--------------------}
- Procedure _P(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := 5;
- Points[1].X := 5 ; Points[1].Y := 5;
- Points[2].X := 5; Points[2].Y := 15;
- Points[3].X := -5; Points[3].Y :=15;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y :=-20;
- Points[1].X := -5; Points[1].Y := -20;
- Points[2].X := -5 ; Points[2].Y := 0;
- Points[3].X := 5 ; Points[3].Y := 0;
- Points[4].X := 15; Points[4].Y :=5;
- Points[5].X := 15; Points[5].Y := 15;
- Points[6].X := 5 ; Points[6].Y := 20;
- Points[7].X := -15 ; Points[7].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{P}
- {--------------------}
- Procedure _Q(posX,posY : byte);
- Var _1,_2,_3:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := -5; Points[0].Y := -5;
- Points[1].X := 0 ; Points[1].Y := -10;
- Points[2].X := 5; Points[2].Y := -5;
- Points[3].X := 5; Points[3].Y := 5;
- Points[4].X := 0; Points[4].Y := 10;
- Points[5].X := -5; Points[5].Y := 5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y :=-10;
- Points[1].X := -5; Points[1].Y := -20;
- Points[2].X := 5 ; Points[2].Y := -20;
- Points[3].X := 15 ; Points[3].Y := -10;
- Points[4].X := 15; Points[4].Y :=10;
- Points[5].X := 5; Points[5].Y := 20;
- Points[6].X := -5 ; Points[6].Y := 20;
- Points[7].X := -15 ; Points[7].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _3 do begin
- NumPoints := 4;
- Points[0].X := 5; Points[0].Y :=-15;
- Points[1].X := 10; Points[1].Y := -20;
- Points[2].X := 15 ; Points[2].Y := -15;
- Points[3].X := 10 ; Points[3].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- BSpline(Random(640),480,20+posX*40,posY*70,_3);
- End;{Q}
- {--------------------}
- Procedure _R(posX,posY : byte);
- Var _1,_2,_3:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := 5;
- Points[1].X := 5 ; Points[1].Y := 5;
- Points[2].X := 5; Points[2].Y := 15;
- Points[3].X := -5; Points[3].Y :=15;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y :=-20;
- Points[1].X := -5; Points[1].Y := -20;
- Points[2].X := -5 ; Points[2].Y := 0;
- Points[3].X := 5 ; Points[3].Y := 0;
- Points[4].X := 15; Points[4].Y :=5;
- Points[5].X := 15; Points[5].Y := 15;
- Points[6].X := 5 ; Points[6].Y := 20;
- Points[7].X := -15 ; Points[7].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _3 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y :=-10;
- Points[1].X := 5; Points[1].Y := -20;
- Points[2].X := 15 ; Points[2].Y := -20;
- Points[3].X := -5 ; Points[3].Y := 0;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- BSpline(Random(640),480,20+posX*40,posY*70,_3);
- End;{R}
- {--------------------}
- Procedure _S(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 8;
- Points[0].X := -15; Points[0].Y := -5;
- Points[1].X := 5 ; Points[1].Y := -5;
- Points[2].X := 5; Points[2].Y := 5;
- Points[3].X := -5; Points[3].Y :=5;
- Points[4].X := -5; Points[4].Y := 10;
- Points[5].X := 15 ; Points[5].Y := 10;
- Points[6].X := 15; Points[6].Y := 20;
- Points[7].X := -15; Points[7].Y :=20;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 6;
- Points[0].X := -15; Points[0].Y :=-20;
- Points[1].X := 15; Points[1].Y := -20;
- Points[2].X := 15 ; Points[2].Y := 5;
- Points[3].X := 5 ; Points[3].Y := 5;
- Points[4].X := 5; Points[4].Y :=-10;
- Points[5].X := -15; Points[5].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{S}
- {--------------------}
- Procedure _T(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 5; Points[2].Y := 10;
- Points[3].X := -5; Points[3].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y := 10;
- Points[1].X := 15; Points[1].Y := 10;
- Points[2].X := 15 ; Points[2].Y := 20;
- Points[3].X := -15 ; Points[3].Y := 20;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{T}
- {--------------------}
- Procedure _U(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 7;
- Points[0].X := 0; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := 15; Points[3].Y := 20;
- Points[4].X := 5; Points[4].Y := 20;
- Points[5].X := 5; Points[5].Y := -5;
- Points[6].X := 0; Points[6].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 7;
- Points[0].X := 0; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -15; Points[2].Y := -10;
- Points[3].X := -15; Points[3].Y := 20;
- Points[4].X := -5; Points[4].Y := 20;
- Points[5].X := -5; Points[5].Y := -5;
- Points[6].X := 0; Points[6].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{U}
- {--------------------}
- Procedure _V(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 6;
- Points[0].X := 0; Points[0].Y := -20;
- Points[1].X := 15 ; Points[1].Y := 0;
- Points[2].X := 15; Points[2].Y := 20;
- Points[3].X := 5; Points[3].Y :=20;
- Points[4].X := 5; Points[4].Y := 0;
- Points[5].X := 0; Points[5].Y :=-5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 6;
- Points[0].X := 0; Points[0].Y := -20;
- Points[1].X := -15 ; Points[1].Y := 0;
- Points[2].X := -15; Points[2].Y := 20;
- Points[3].X := -5; Points[3].Y :=20;
- Points[4].X := -5; Points[4].Y := 0;
- Points[5].X := 0; Points[5].Y :=-5;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{V}
- {--------------------}
- Procedure _W(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 7;
- Points[0].X := 0; Points[0].Y := -10;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -15; Points[2].Y := -10;
- Points[3].X := -15; Points[3].Y :=20;
- Points[4].X := -5; Points[4].Y := 20;
- Points[5].X := -5; Points[5].Y :=-5;
- Points[6].X := 0; Points[6].Y := 5;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 7;
- Points[0].X := 0; Points[0].Y := -10;
- Points[1].X := 5 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := 15; Points[3].Y :=20;
- Points[4].X := 5; Points[4].Y := 20;
- Points[5].X := 5; Points[5].Y :=-5;
- Points[6].X := 0; Points[6].Y := 5;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{W}
- {--------------------}
- Procedure _X(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 11;
- Points[0].X := -15; Points[0].Y := 20;
- Points[1].X := -5 ; Points[1].Y :=20;
- Points[2].X := -5; Points[2].Y := 10;
- Points[3].X := 0; Points[3].Y :=5;
- Points[4].X := 5; Points[4].Y := 10;
- Points[5].X := 5; Points[5].Y := 20;
- Points[6].X := 15; Points[6].Y :=20;
- Points[7].X := 15; Points[7].Y :=10;
- Points[8].X := 10; Points[8].Y := 0;
- Points[9].X := -10; Points[9].Y :=0;
- Points[10].X := -15; Points[10].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 11;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := -5 ; Points[1].Y := -20;
- Points[2].X := -5; Points[2].Y := -10;
- Points[3].X := 0; Points[3].Y :=-5;
- Points[4].X := 5; Points[4].Y := -10;
- Points[5].X := 5; Points[5].Y := -20;
- Points[6].X := 15; Points[6].Y :=-20;
- Points[7].X := 15; Points[7].Y :=-10;
- Points[8].X := 10; Points[8].Y := 0;
- Points[9].X := -10; Points[9].Y :=0;
- Points[10].X := -15; Points[10].Y := -10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{X}
- {--------------------}
- Procedure _Y(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -5; Points[0].Y := -20;
- Points[1].X := 5 ; Points[1].Y :=-20;
- Points[2].X := 5; Points[2].Y := 0;
- Points[3].X := -5; Points[3].Y := 0;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _1 do begin
- NumPoints := 11;
- Points[0].X := -5; Points[0].Y := 0;
- Points[1].X := 5 ; Points[1].Y := 0;
- Points[2].X := 15; Points[2].Y := 10;
- Points[3].X := 15; Points[3].Y := 20;
- Points[4].X := 5; Points[4].Y := 20;
- Points[5].X := 5; Points[5].Y := 10;
- Points[6].X := 0; Points[6].Y := 5;
- Points[7].X := -5; Points[7].Y :=10;
- Points[8].X := -5; Points[8].Y :=20;
- Points[9].X := -15; Points[9].Y :=20;
- Points[10].X := -15; Points[10].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{Y}
- {--------------------}
- Procedure _Z(posX,posY : byte);
- Var _1,_2:poly;
- Begin
- Randomize;
- with _1 do begin
- NumPoints := 7;
- Points[0].X := -15; Points[0].Y := -20;
- Points[1].X := 15 ; Points[1].Y := -20;
- Points[2].X := 15; Points[2].Y := -10;
- Points[3].X := -5; Points[3].Y := -10;
- Points[4].X := 15; Points[4].Y := 10;
- Points[5].X := 5; Points[5].Y := 10;
- Points[6].X := -15; Points[6].Y :=-10;
- Repeat Color := Random(15); until color <> Black;
- End;
- with _2 do begin
- NumPoints := 4;
- Points[0].X := -15; Points[0].Y := 20;
- Points[1].X := 15 ; Points[1].Y := 20;
- Points[2].X := 15; Points[2].Y := 10;
- Points[3].X := -15; Points[3].Y := 10;
- Repeat Color := Random(15); until color <> Black;
- End;
- BSpline(Random(640),480,20+posX*40,posY*70,_1);
- BSpline(Random(640),480,20+posX*40,posY*70,_2);
- End;{Z}
- {--------------------}
- Procedure WriteText(T : string);
- Var j,i,con : byte;
- Begin
- IF length(t) < 14 then con := abs(14-length(t))div 2 else con := 0;
- For i := 1 to length(t) do
- begin
- IF I < 14 then BEGIN
- j := i + con;
- case t[i] of
- 'A','a' : _A(j,3);
- 'B','b' : _B(j,3);
- 'C','c' : _C(j,3);
- 'D','d' : _D(j,3);
- 'E','e' : _E(j,3);
- 'F','f' : _F(j,3);
- 'G','g' : _G(j,3);
- 'H','h' : _H(j,3);
- 'I','i' : _I(j,3);
- 'J','j' : _J(j,3);
- 'K','k' : _K(j,3);
- 'L','l' : _L(j,3);
- 'M','m' : _M(j,3);
- 'N','n' : _N(j,3);
- 'O','o' : _O(j,3);
- 'P','p' : _P(j,3);
- 'Q','q' : _Q(j,3);
- 'R','r' : _R(j,3);
- 'S','s' : _S(j,3);
- 'T','t' : _T(j,3);
- 'U','u' : _U(j,3);
- 'V','v' : _V(j,3);
- 'W','w' : _W(j,3);
- 'X','x' : _X(j,3);
- 'Y','y' : _Y(j,3);
- 'Z','z' : _Z(j,3);
- end;
- END;
- end;
- End;{WriteText}
- {------------------------------}
- VAR i,j : integer;
- str : string;
- BEGIN
- InitObj;
- Write('‚¢¥¤¨â¥ áâபã: ');
- ReadLn(Str);
- I := Detect;
- InitGraph(I, J, '');
- SetWriteMode(XORPUT);
- WriteText(Str);
- ReadKey;
- CloseGraph;
- END.
|