Uses Knihovna,Crt; Var R1,R2,R3,R4:string; St,St2:string[3]; i,o,p:integer; A,B:byte; R:Char; Label Start,Dal,Vykresli; Procedure Okraj; Var i:integer; Begin Locate(2,1,R1); Locate(2,23,R3); For i:=2 to 21 do Begin Locate(80,i+1,Copy(R2,i,1)); Locate(1,i+1,Copy(R4,i,1)); End; R1:=Copy(R1,78,1)+Copy(R1,1,77); R2:=Copy(R2,21,1)+Copy(R2,1,20); R3:=Copy(R3,2,77)+Copy(R3,1,1); R4:=Copy(R4,2,20)+Copy(R4,1,1); Delay(100); End; (**) Begin St:='**+'; St2:=Copy(St,3,1)+Copy(St,1,2); R1:=Strings(26,st); {ABC} R2:=Strings(7,st); {ABC} R3:=Strings(26,st2); {CBA} R4:=Strings(7,st2); {CBA} Barva(2,7);ClrScr; (**) A:=0;B:=0; Pismo(1); Locate(1,1,'/');Locate(80,1,'\');Locate(80,23,'/');Locate(1,23,'\'); Locate(1,3,DejNastred('VYBERTE TVAR TROJUHELNIKU:')); Locate(1,6,DejNastred('Tabelatorem vyberte trojuhenik,')); Locate(1,7,DejNastred('s nimz chcete pracovat,')); Locate(1,8,DejNastred('a stisknete enter.')); VytvorRam(3,2,78,22,2); Pismo(0); i:=15;o:=6; Pismo(2);VytvorRam(9,5,21,10,1);Pismo(0); Locate(i,o,'*');Locate(i-1,o+1,'***');Locate(i-2,o+2,'*****');Locate(i-3,o+3,'*******'); i:=65;o:=6; VytvorRam(60,5,72,10,1); Locate(i,o,'*');Locate(i,o+1,'**');Locate(i,o+2,'***');Locate(i,o+3,'****'); Start: Pismo(2); Repeat Okraj Until KeyPressed; R:=Readkey; Case Ord(R) of 9 : Begin If A=1 Then Begin A:=0; Pismo(2);VytvorRam(9,5,21,10,1);Pismo(0); VytvorRam(60,5,72,10,1);Goto Start; End Else Begin A:=1;Pismo(0);VytvorRam(9,5,21,10,1); Pismo(2);VytvorRam(60,5,72,10,1);Pismo(0);Goto Start; End; End; 13: Goto Dal; Else Goto Start; End; Dal: Pismo(0);i:=66;o:=6;Locate(i-3,o+3,' * ');Locate(i-1,o+2,'***');Locate(i-2,o+1,'*****');Locate(i-3,o,'*******');Pismo(2); Case A of 0: Begin Repeat Okraj Until KeyPressed; R:=Readkey; Case Ord(R) Of 9:Begin If B=1 Then Begin B:=0; Pismo(2);VytvorRam(9,5,21,10,1);Pismo(0); VytvorRam(60,5,72,10,1);Goto Dal; End Else Begin B:=1;Pismo(0);VytvorRam(9,5,21,10,1); Pismo(2);VytvorRam(60,5,72,10,1);Pismo(0);Goto Dal; End; End; 13: Goto Vykresli; Else Goto Dal; End; End; End; Vykresli: Pismo(2);Locate(9,12,'Zadejte pocet radku trojuhelnika: ');Pismo(0);Read(i); Pismo(2);Locate(9,13,'Zadejte velikost kroku (implicitne 1): ');Pismo(0);Read(o); Barva(2,1); ClrScr;VytvorRam(1,1,80,23,2); if A=0 then Begin if b=0 then Begin For p:=1 to i do Begin Locate(40-p*o,p+(23-2*i) div 2,Strings((2*p-1)*o,'*')); End;End; if b=1 then Begin For p:=1 to i do Begin Locate(40-p*o,i-p+(23-2*i) div 2,Strings((2*p-1)*o,'*')); End;End; End; Readkey; End.