Advertisement
Gromov

Untitled

Dec 18th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.19 KB | None | 0 0
  1. program Biatlons;
  2. USES CRT,GRAPH,math;
  3. var x,x1,x2,x3,x4,x5,y,y1,y2,y3,y4,y5,M1,M2,M3,M4,M5:integer;
  4. START,BL,T1,SA ,P1,P2,P3,P4,P5,TX1,TY1,TX2,TY2,TX3,TY3,TX4,TY4,TX5,TY5:Integer; d,m:SMALLINT;
  5. BEGIN
  6. InitGraph(d,m,''); SetBkColor(123); ClearDevice; SetColor(Blue); SetFillSTYLE(1,16); line(150,250,450,250); line(150,250,150,900); line(150,900,1050,900); line(1050,900,1050,250); line(1050,250,700,250); line(200,300,450,300); line(200,300,200,850); line(200,850,1000,850); line(1000,850,1000,300); line(700,300,1000,300); line(500,300,650,300); line(500,300,500,700); line(450,300,450,750); line(450,750,700,750); line(500,700,650,700); line(650,700,650,550); line(700,750,700,600); line(700,600,900,600); line(650,550,850,550); line(850,550,850,400); line(900,600,900,350); line(900,350,700,350); line(700,350,700,300); line(850,400,650,400); line(650,400,650,300); circle(525,125,10);
  7. circle(550,125,10); circle(575,125,10); circle(600,125,10); circle(625,125,10); circle(175,275,5); ///Tribūnas
  8. ///rectangle(25,150,75,950); circle(50,175,5); setfillstyle(5,11); fillEllipse(50,175, 10, 10); circle(50,225,5); setfillstyle(4,10); fillEllipse(50,225, 10, 10); circle(50,275,5); setfillstyle(3,12); fillEllipse(50,275, 10, 10); circle(50,325,5); setfillstyle(2,13); fillEllipse(50,325, 10, 10); circle(50,375,5); setfillstyle(6,6); fillEllipse(50,375, 10, 10); circle(50,425,5); setfillstyle(1,8); fillEllipse(50,425, 10, 10); circle(50,475,5); setfillstyle(2,3); fillEllipse(50,475, 10, 10); circle(50,525,5); setfillstyle(7,2); fillEllipse(50,525, 10, 10); circle(50,575,5); setfillstyle(3,9); fillEllipse(50,575, 10, 10); circle(50,625,5); setfillstyle(6,1); fillEllipse(50,625, 10, 10); circle(50,675,5); setfillstyle(2,7); fillEllipse(50,675, 10, 10); circle(50,725,5); setfillstyle(8,5); fillEllipse(50,725, 10, 10); circle(50,775,5); setfillstyle(5,15);
  9.  
  10. fillEllipse(50,775, 10, 10); circle(50,825,5); setfillstyle(2,12); fillEllipse(50,825, 10, 10); circle(50,875,5); setfillstyle(4,7); fillEllipse(50,875, 10, 10); circle(50,925,5); setfillstyle(6,6); fillEllipse(50,925, 10, 10); rectangle(75,950,125,150); circle(100,175,5); setfillstyle(4,16); fillEllipse(100,175, 10, 10); circle(100,225,5); setfillstyle(5,13); fillEllipse(100,225, 10, 10); circle(100,275,5); setfillstyle(3,12); fillEllipse(100,275, 10, 10); circle(100,325,5); setfillstyle(2,13); fillEllipse(100,325, 10, 10); circle(100,375,5); setfillstyle(6,11); fillEllipse(100,375, 10, 10); circle(100,425,5); setfillstyle(2,4); fillEllipse(100,425, 10, 10); circle(100,475,5); setfillstyle(5,7); fillEllipse(100,475, 10, 10); circle(100,525,5); setfillstyle(4,8); fillEllipse(100,525, 10, 10); circle(100,575,5); setfillstyle(2,8); fillEllipse(100,575, 10, 10); circle(100,625,5); setfillstyle(5,15); fillEllipse(100,625, 10, 10); circle(100,675,5); setfillstyle(4,16); fillEllipse(100,675, 10, 10); circle(100,725,5); setfillstyle(5,11);
  11.  
  12. fillEllipse(100,725, 10, 10); circle(100,775,5); setfillstyle(1,9); fillEllipse(100,775, 10, 10); circle(100,825,5); setfillstyle(6,6); fillEllipse(100,825, 10, 10); circle(100,875,5); setfillstyle(4,10); fillEllipse(100,875, 10, 10); circle(100,925,5); setfillstyle(5,7); fillEllipse(100,925, 10, 10);
  13. ///
  14. Writeln(' START ? '); Readln(START);
  15. Begin
  16. ///Pārvietošanās
  17. x:=175;
  18. while(x<575)do
  19. begin setcolor(blue); x:=x+2; circle(x,275,5); setcolor(blue); delay(15); circle(x,275,5); end;
  20. y:=275; while(y>200)do
  21. begin setcolor(blue); y:=y-2; circle(575,y,5); setcolor(blue); delay(15); circle(575,y,5); end;
  22. setcolor(blue);
  23. circle(575,200,5);
  24. //Shooting
  25. Writeln(' KOORDINATS 1-10(X),1-10(Y) ! ');
  26. WRITELN(' IEVADI PA VIENAM X PIRMAIS Y OTRAIS ! '); Readln(x1);
  27. readln(y1);
  28.  
  29. if (x1>=1) and (x1<=10) then begin TX1:=1;
  30. end
  31. ELSE IF(x1<1) and (x1>10) then begin
  32. TX1:=0;
  33. END;
  34. IF (y1>=1) and (y1<=10) then begin
  35. TY1:=1;
  36. end
  37. ELSE IF(y1<1) and (y1>10) then begin
  38. TY1:=0; END; begin
  39. P1:= TY1+TX1;
  40. end;
  41. IF(P1=2)THEN BEGIN setfillstyle(5,8); fillEllipse(525, 125, 10, 10);
  42. M1:=0
  43. END
  44. ELSE IF (P1<4) THEN BEGIN
  45. M1:=1;
  46. END;
  47. Writeln(' KOORDINATS 11-20(X),11-20(Y) ! ');
  48. WRITELN(' IEVADI PA VIENAM X PIRMAIS Y OTRAIS ! '); Readln(x2);
  49. readln(y2);
  50. if (x2>=11) and (x2<=20) then begin
  51. TX2:=1;
  52. end
  53. ELSE IF(x2<11) and (x2>20) then begin
  54. TX2:=0;
  55. END;
  56. IF (y2>=11) and (y2<=20) then begin
  57. TY2:=1;
  58. end
  59. ELSE IF(y2<11) and (y2>20) then begin
  60. TY2:=0; END; begin
  61. P2:= TY2+TX2;
  62. end;
  63. IF(P2=2)THEN BEGIN setfillstyle(5,9); fillEllipse(550, 125, 10, 10);
  64. M2:=0
  65.  
  66. END
  67. ELSE IF (P2<4) THEN BEGIN
  68. M2:=1;
  69. END;
  70. Writeln(' KOORDINATS 21-30(X),21-30(Y) ! '); Readln(x3);
  71. readln(y3);
  72. if (x3>=21) and (x3<=30) then begin
  73. TX3:=1;
  74. end
  75. ELSE IF(x3<21) and (x3>30) then begin
  76. TX3:=0;
  77. END;
  78. IF (y3>=21) and (y3<=30) then begin
  79. TY3:=1;
  80. end
  81. ELSE IF(y3<21) and (y3>30) then begin
  82. TY3:=0;
  83. END; begin
  84. P3:= TY3+TX3;
  85. end;
  86. IF(P3=2)THEN BEGIN
  87. setfillstyle(5,10); fillEllipse(575, 125, 10, 10); M3:=0
  88. END
  89. ELSE IF (P3<4) THEN BEGIN M3:=1;
  90. END;
  91. Writeln(' KOORDINATS 31-40(X),31-40(Y) ! ');
  92. WRITELN(' IEVADI PA VIENAM X PIRMAIS Y OTRAIS ! '); Readln(x4);
  93. readln(y4);
  94. if (x4>=31) and (x4<=40) then begin
  95. TX4:=1;
  96. end
  97. ELSE IF(x4<31) and (x4>40) then begin
  98. TX4:=0;
  99. END;
  100. IF (y4>=31) and (y4<=40) then begin
  101. TY4:=1;
  102. end
  103. ELSE IF(y4<31) and (y4>40) then begin
  104. TY4:=0; END;
  105.  
  106. begin
  107. P4:= TY4+TX4; end;
  108. IF(P4=2)THEN BEGIN setfillstyle(5,11); fillEllipse(600, 125, 10, 10);
  109. M4:=0
  110. END
  111. ELSE IF (P4<4) THEN BEGIN
  112. M4:=1;
  113. END;
  114. Writeln(' KOORDINATS 41-50(X),41-50(Y) ! '); Readln(x5);
  115. readln(y5);
  116. if (x5>=41) and (x5<=50) then begin
  117. TX5:=1;
  118. end
  119. ELSE IF(x5<41) and (x5>50) then begin
  120. TX5:=0;
  121. END;
  122. IF (y5>=41) and (y5<=50) then begin
  123. TY5:=1;
  124. end
  125. ELSE IF(y5<41) and (y5>50) then begin
  126. TY5:=0;
  127. END; begin
  128. P5:= TY5+TX5;
  129. end;
  130. IF(P5=2)THEN BEGIN setfillstyle(5,12);
  131. fillEllipse(625, 125, 10, 10); M5:=0;
  132. END
  133. ELSE IF (P5<4) THEN BEGIN M5:=1;
  134. END;
  135. SA:=M5+M4+M3+M2+M1; y:=200;
  136. while(y<275)do
  137. begin setcolor(blue); y:=y+2; circle(575,y,5); setcolor(blue); delay(15);
  138.  
  139. circle(575,y,5);
  140. end;
  141. if(SA>0) then begin
  142. for BL:=1 to SA DO begin
  143. x:=575; while(x<675)do begin setcolor(blue); x:=x+2; circle(x,275,5); setcolor(blue); delay(15); circle(x,275,5); end;
  144. Y:=275; while(y<375)do begin setcolor(blue); y:=y+2; circle(675,y,5); setcolor(blue); delay(15); circle(675,y,5); end;
  145. x:=675; while(x<875)do begin setcolor(blue); x:=x+2; circle(x,375,5); setcolor(blue); delay(15); circle(x,375,5); end;
  146. Y:=375; while(y<575)do begin setcolor(blue); y:=y+2; circle(875,y,5); setcolor(blue); delay(15); circle(875,y,5); end;
  147. x:=875;
  148.  
  149. while(x>675)do begin setcolor(blue); x:=x-2; circle(x,575,5); setcolor(blue); delay(15); circle(x,575,5); end;
  150. Y:=575; while(y<725)do begin setcolor(blue); y:=y+2; circle(675,y,5); setcolor(blue); delay(15); circle(675,y,5); end;
  151. x:=675; while(x>475)do begin setcolor(blue); x:=x-2; circle(x,725,5); setcolor(blue); delay(15); circle(x,725,5); END;
  152. Y:=725; while(y>275)do begin setcolor(blue); y:=y-2; circle(475,y,5); setcolor(blue); delay(15); circle(475,y,5); end;
  153. x:=475; while(x<575)do begin setcolor(blue); x:=x+2; circle(x,275,5); setcolor(blue);
  154.  
  155. delay(15); circle(x,275,5); end;
  156. END;
  157. x:=575; while(x<675)do
  158. begin setcolor(blue); x:=x+2; circle(x,275,5); setcolor(blue); delay(15); circle(x,275,5); end;
  159. x:=675;
  160. while(x<1025)do begin
  161. setcolor(blue); x:=x+2; circle(x,275,5); setcolor(blue); delay(15); circle(x,275,5); end;
  162. y:=275; while(y<875)do
  163. begin setcolor(blue); y:=y+2; circle(1025,y,5); setcolor(blue); delay(15); circle(1025,y,5); end;
  164. x:=1025; while(x>175)do
  165. begin setcolor(blue); x:=x-2; circle(x,875,5); setcolor(blue); delay(15); circle(x,875,5); end;
  166. y:=875; while(y>275)do
  167.  
  168. begin setcolor(blue); y:=y-2; circle(175,y,5); setcolor(blue); delay(15); circle(175,y,5); end;
  169. end
  170. else if (SA=0)then begin x:=575; while(x<1025)do
  171. begin setcolor(blue); x:=x+2; circle(x,275,5); setcolor(blue); delay(15); circle(x,275,5); end;
  172. y:=275; while(y<875)do
  173. begin setcolor(blue); y:=y+2; circle(1025,y,5); setcolor(blue); delay(15); circle(1025,y,5); end;
  174. x:=1025; while(x>175)do
  175. begin setcolor(blue); x:=x-2; circle(x,875,5); setcolor(blue); delay(15); circle(x,875,5); end;
  176. y:=875; while(y>275)do
  177. begin setcolor(blue); y:=y-2;
  178.  
  179. circle(175,y,5); setcolor(blue); delay(15); circle(175,y,5); end;
  180. setcolor(blue); circle(175,275,5);
  181. end; end; end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement