Встречено 'as', а ожидался идентификатор - PascalABC.NET

Узнай цену своей работы

Формулировка задачи:

Встречено 'as', а ожидался идентификатор 17 строка
Листинг программы
  1. Program Sme;
  2. uses crt;
  3. type
  4. reca=record
  5. name:string[10];
  6. resultat:integer;
  7. end;
  8. var
  9. aa:reca;
  10. Xz,Yz:array [1..40] of byte;
  11. us:array [1..11] of reca;
  12. i,j,a,k,k2,kk,och,z:integer;
  13. H,W,hl,hr,Ww,Wn,PlayE,Play:ShortInt;
  14. X1,Y1,x,y,d:byte;
  15. Kno,onk:Char;
  16. SL,Schot:Word;
  17. Ax,Ay,Bx,By,Ex,Ey,as,sa:Byte;
  18. f1:text;
  19. f2:file of integer;
  20. f3:text;
  21. f4:text;
  22. namen:string[10];
  23. resul:string[20];
  24. prav:string;
  25. q,wq,qq,qw:string[15];
  26. Procedure stolknovenie;
  27. begin
  28. for i:=2 to d-2 do
  29. begin
  30. if (Xz[i]=Xz[i+2]) and (Yz[i]=Yz[i+2]) then
  31. as:=0 else as:=1;
  32. sa:=sa*as;
  33. end;
  34. for i:=1 to d-3 do
  35. begin
  36. if (sa<>0) and (xz[1]=xz[i+3]) and (yz[1]=yz[i+3]) then Play:=0;
  37. end;
  38. if (Xz[1]=3) or (Xz[1]=57) or (Yz[1]=3) or (Yz[1]=22) Then Play:=0;
  39. end;
  40. Procedure Ramka(Xr,Yr:Byte; tt: string; c:byte);
  41. begin
  42. TextColor(c);
  43. GotoXY (Xr,Yr+1);
  44. write (tt);
  45. For i:=Xr to Xr+20 do
  46. begin
  47. GotoXY (i,Yr);
  48. write ('*');
  49. GotoXY (i,Yr+2);
  50. write ('*');
  51. end;
  52. For i:=Yr to Yr+2 do
  53. begin
  54. GotoXY (Xr,i);
  55. write ('*');
  56. GotoXY (Xr+20,i);
  57. write ('*');
  58. end;
  59. end;
  60. Procedure Izm(vv:byte);
  61. Begin
  62. Ax:=Bx; Ay:=By;
  63. Bx:=Xz[vv]; By:=Yz[vv];
  64. Xz[vv]:=Ax; Yz[vv]:=Ay;
  65. End;
  66. Procedure menu2 (q,qq,wq,qw:string);
  67. begin
  68. Clrscr;
  69. TextBackground (0);
  70. TextColor (15);
  71. For X1:=25 to 55 do
  72. Begin
  73. GotoXY (X1,4);
  74. Write ('*');
  75. GotoXY (X1,22);
  76. Write ('*');
  77. end;
  78. For Y1:=4 to 22 do
  79. begin
  80. GotoXY (25,Y1);
  81. Write ('*');
  82. GotoXY (55,Y1);
  83. Write ('*');
  84. end;
  85. GotoXY (31,7);
  86. Write (q);
  87. K2:=0;
  88. repeat
  89. K2:=k2+kk;
  90. kk:=0;
  91. If k2=0 Then Ramka (30,10,qq,128) else
  92. Ramka (30,10,qq,15);
  93. If k2=1 then Ramka (30,14,wq,128) else
  94. Ramka (30,14,wq,15);
  95. IF K2=2 Then Ramka (30,18,qw,128) else
  96. Ramka (30,18,qw,15);
  97. Kno:=ReadKey;
  98. If Kno=#80 then Begin if k2<2 then kk:=1 else kk:=0; end else
  99. if Kno=#72 then Begin if k2>0 then kk:=-1 else kk:=0; end;
  100. until Kno=chr(13);
  101. end;
  102. Procedure Spravka;
  103. begin
  104. menu2(' СПРАВКА',' ПРАВИЛА ИГРЫ ',' РАЗРАБОТЧИК ',' НАЗАД ');
  105. if k2=0 then
  106. begin
  107. clrscr;
  108. assign(f4,'d:\kkk\pravila.pas');
  109. reset(f4);
  110. i:=3;
  111. While not EOF(f4) do
  112. begin
  113. GotoXY(3,i);
  114. i:=i+2;
  115. readln(f4,prav);
  116. writeln(prav);
  117. end;
  118. readln;
  119. end;
  120. if k2=1 then
  121. begin
  122. clrscr;
  123. TextBackground(0);
  124. TextColor (4);
  125. For X1:=3 to 77 do
  126. Begin
  127. GotoXY (x1,2);
  128. Write ('*');
  129. GotoXY (X1,23);
  130. write ('*');
  131. end;
  132. For Y1:=2 to 23 do
  133. Begin
  134. GotoXY (3,Y1);
  135. Write ('*');
  136. GotoXY (77,y1);
  137. Write ('*');
  138. end;
  139. assign(f4,'d:\kkk\avtor.pas');
  140. reset(f4);
  141. d:=7;
  142. While not EOF (f4) do
  143. begin
  144. textcolor(10);
  145. readln(f4,prav);
  146. GotoXY (19,d);
  147. Write (prav);
  148. d:=d+2;
  149. for i:=1 to 4 do
  150. Delay (59000);
  151. end;
  152. close(f4);
  153. readln;
  154. end;
  155. if k2=2 then
  156. TextBackground (0);
  157. textcolor(15);
  158. end;
  159. Procedure Resultat;
  160. begin
  161. clrscr;
  162. reset(f1);
  163. for i:=1 to 10 do
  164. begin
  165. readln(f1,us[i].name);
  166. end;
  167. close(f1);
  168. reset(f2);
  169. for i:=1 to 10 do
  170. read(f2,us[i].resultat);
  171. close(f2);
  172. gotoXy(25,12);
  173. If schot>us[10].resultat then
  174. begin
  175. writeln('Ваш результат составил: ', schot);
  176. gotoxy(30,13);
  177. writeln('Введите ваше имя...');
  178. gotoxy(36,14);
  179. read(namen);
  180. end
  181. else
  182. begin
  183. GotoXY(23,13);
  184. writeln('Вы не побили самый худший результат!!! :(');
  185. GotoXY(13,14);
  186. writeln('Но не огорчайтесь!!! Вы можете просто написать ваше имя!!!)))');
  187. GotoXY(36,15);
  188. readln(namen);
  189. end;
  190. us[11].name:=namen;
  191. us[11].resultat:=schot;
  192. for i:=1 to 11 do
  193. for j:=2 to 11 do
  194. begin
  195. if us[j].resultat>us[j-1].resultat then
  196. begin
  197. aa:=us[j-1];
  198. us[j-1]:=us[j];
  199. us[j]:=aa;
  200. end;
  201. end;
  202. rewrite(f1);
  203. for i:=1 to 10 do
  204. begin
  205. write(f1,us[i].name);
  206. writeln(f1,' ');
  207. end;
  208. close(f1);
  209. rewrite(f2);
  210. for i:=1 to 10 do
  211. write(f2,us[i].resultat);
  212. close(f2);
  213. rewrite(f3);
  214. for i:=1 to 10 do
  215. writeln(f3,i,': ',us[i].resultat,' ',us[i].name);
  216. close(f3);
  217. end;
  218. begin
  219. assign (f3,'d:\kkk\itog.txt');
  220. assign (f1,'d:\kkk\imena.txt');
  221. assign (f2,'d:\kkk\rec.dat');
  222. repeat
  223. repeat
  224. Clrscr;
  225. TextBackground (0);
  226. TextColor (15);
  227. For X1:=25 to 55 do
  228. Begin
  229. GotoXY (X1,4);
  230. Write ('*');
  231. GotoXY (X1,22);
  232. Write ('*');
  233. end;
  234. For Y1:=4 to 22 do
  235. begin
  236. GotoXY (25,Y1);
  237. Write ('*');
  238. GotoXY (55,Y1);
  239. Write ('*');
  240. end;
  241. K:=0;
  242. Repeat
  243. k:=k+kk;
  244. kk:=0;
  245. If k=0 Then Ramka (30,6,' ИГРАТЬ ',128) else
  246. Ramka (30,6,' ИГРАТЬ ',15);
  247. If k=1 Then Ramka (30,10,' РЕКОРДЫ ',128) else
  248. Ramka (30,10,' РЕКОРДЫ ',15);
  249. If k=2 then Ramka (30,14,' СПРАВКА ',128) else
  250. Ramka (30,14,' СПРАВКА ',15);
  251. If k=3 then Ramka (30,18,' ВЫХОД ',128) else
  252. Ramka (30,18,' ВЫХОД ',15);
  253. Kno:=ReadKey;
  254. If Kno=#80 then Begin if k<3 then kk:=1 else kk:=0; end else
  255. if Kno=#72 then Begin if k>0 then kk:=-1 else kk:=0; end;
  256. until Kno=chr(13);
  257. If k=1 then
  258. begin
  259. Clrscr;
  260. GotoXy(36,5);
  261. writeln('РЕКОРДЫ');
  262. reset (f3);
  263. for i:=1 to 10 do
  264. begin
  265. readln(f3,resul);
  266. GotoXY (32,7+i);
  267. Write(resul);
  268. end;
  269. close(f3);
  270. Readln;
  271. end;
  272. If k=2 then
  273. repeat
  274. spravka;
  275. until k2=2;
  276. If k=3 then
  277. exit;
  278. until (k=3) or (k=0);
  279. If k=0 then begin
  280. menu2 (' УРОВЕНЬ СЛОЖНОСТИ',' ГЛИСТ ',' ЗМЕЯ ',' АНАКОНДА ');
  281. end;
  282. If K2=0 then begin Sl:=40000; och:=25; d:=5 end else if k2=1 then begin
  283. Sl:=30000; och:=50; d:=10 end else begin Sl:=20000; och:=100; d:=15 end;
  284. TextBackground (1);
  285. Textcolor (5);
  286. clrscr;
  287. schot:=0; playE:=1;
  288. Xz[1]:=30;
  289. Yz[1]:=13;
  290. For i:=2 to 40 do
  291. begin
  292. Xz[i]:=Xz[1];
  293. Yz[i]:=Yz[1];
  294. end;
  295. For X1:=3 to 57 do
  296. Begin
  297. GotoXY (x1,2);
  298. Write ('*');
  299. GotoXY (X1,23);
  300. write ('*');
  301. end;
  302. For Y1:=2 to 23 do
  303. Begin
  304. GotoXY (3,Y1);
  305. Write ('*');
  306. GotoXY (57,y1);
  307. Write ('*');
  308. end;
  309. Play:=1;
  310. GotoXY(60,4);
  311. write('СЧЕТ: ');
  312. GotoXY(60,6);
  313. write('Рост змеи: ');
  314. gotoXY(60,8);
  315. write('Лучшие результаты:');
  316. reset(f3);
  317. for i:=1 to 3 do
  318. begin
  319. readln(f3,resul);
  320. GotoXY (60,9+i);
  321. Write(resul);
  322. end;
  323. close(f3);
  324. Repeat
  325. If play=1 then begin
  326. TextColor (4);
  327. Ax:=xz[1]; Ay:=Yz[1];
  328. Xz[1]:=Xz[1]+H; Yz[1]:=Yz[1]+W;
  329. Bx:=Xz[2]; By:=Yz[2];
  330. Xz[2]:=Ax; Yz[2]:=Ay;
  331. For i:=3 to 40 do
  332. izm(i);
  333. GotoXY (Xz[1],Yz[1]);
  334. write(chr(1));
  335. For i:=2 to d do
  336. begin
  337. GotoXY (Xz[i],Yz[i]);
  338. Write(chr(4));
  339. end;
  340. Delay(SL);
  341. Textcolor (1);
  342. GotoXY (Xz[1],Yz[1]);
  343. write(chr(1));
  344. For i:=2 to 40 do
  345. begin
  346. GotoXY (Xz[i],Yz[i]);
  347. Write(chr(4));
  348. end;
  349. randomize;
  350. if PlayE=1 then
  351. begin
  352. Ex:=Random(54)+4;
  353. Ey:=random(18)+4;
  354. If (K2=0) and (schot<>0) and ((schot mod 75)=0) then
  355. d:=d+1;
  356. if (k2=0) and (schot<>0) and ((schot mod 150)=0) then
  357. Sl:=Sl-500;
  358. If (K2=1) and (schot<>0) and ((schot mod 150)=0) then
  359. d:=d+1;
  360. if (k2=1) and (schot<>0) and ((schot mod 500)=0) then
  361. Sl:=Sl-500;
  362. If (K2=2) and (schot<>0) and ((schot mod 500)=0) then
  363. d:=d+1;
  364. if (k2=2) and (schot<>0) and ((schot mod 1000)=0) then
  365. Sl:=Sl-500;
  366. PlayE:=0; end;
  367. Textcolor (6);
  368. GotoXY(Ex,Ey);
  369. write(chr(6));
  370. if (Xz[1]=Ex) and (Yz[1]=Ey) then
  371. begin
  372. schot:=schot+och;
  373. PlayE:=1;
  374. Textcolor (1);
  375. GotoXy(Ex,Ey);
  376. write (' ');
  377. end;
  378. Case Kno of
  379. #72: Begin W:=-1; H:=0; end;
  380. #80: Begin W:=1; H:=0; end;
  381. #77: Begin W:=0; H:=1; end;
  382. #75: Begin W:=0; h:=-1; end;
  383. end;
  384. If Keypressed=true then begin onk:=readkey;Kno:=Readkey; end;
  385. end;
  386. GotoXY(66,4);
  387. write(Schot);
  388. GotoXY(70,6);
  389. write(d);
  390. sa:=10;
  391. stolknovenie;
  392. until Play=0;
  393. If play=0 then begin
  394. TextBackground (0);
  395. Textcolor (15);
  396. clrscr;
  397. GotoXY(6,8);
  398. write(' ***** ***** * * ******* ***** ** ** ******* ****** ');
  399. GotoXY(6,9);
  400. write('******* ******* ** ** ******* ******* ** ** ******* *******');
  401. GotoXY(6,10);
  402. write('** ** ** *** *** ** ** ** ** ** ** ** **');
  403. GotoXY(6,11);
  404. write('** ** ** **** **** ** ** ** ** ** ** ** **');
  405. GotoXY(6,12);
  406. write('** ** ** ** *** ** **** ** ** ** ** **** ** **');
  407. GotoXY(6,13);
  408. write('** ** ******* ** * ** **** ** ** ** ** **** ****** ');
  409. GotoXY(6,14);
  410. write('** *** ******* ** ** ** ** ** ** ** ** **** ');
  411. GotoXY(6,15);
  412. write('** ** ** ** ** ** ** ** ** ** ** ** ** ** ');
  413. GotoXY(6,16);
  414. write('******* ** ** ** ** ******* ******* *** ******* ** ** ');
  415. GotoXY(6,17);
  416. write(' ***** ** ** ** ** ******* ***** * ******* ** **');
  417. GotoXY(25,23);
  418. Write('Для продолжения нажмите ENTER');
  419. repeat
  420. kno:=readkey;
  421. until Kno=chr(13);
  422. end;
  423. resultat;
  424. H:=0; w:=0; k:=0; kk:=0;
  425. until k=3; end.

Решение задачи: «Встречено 'as', а ожидался идентификатор»

textual
Листинг программы
  1. program Sme;
  2.  
  3. uses
  4.   crt;
  5.  
  6. type
  7.   reca = record
  8.     name: string[10];
  9.     resultat: integer;
  10.   end;
  11.  
  12. var
  13.   aa: reca;
  14.   Xz, Yz: array [1..40] of byte;
  15.   us: array [1..11] of reca;
  16.   i, k, k2, kk, och: integer;
  17.   H, W, PlayE, Play: ShortInt;
  18.   X1, Y1, d: byte;
  19.   Kno, onk: Char;
  20.   SL, Schot: Word;
  21.   Ax, Ay, Bx, By, Ex, Ey, es, sa: Byte;
  22.   f1: text;
  23.   f2: file of integer;
  24.   f3: text;
  25.   f4: text;
  26.   namen: string[10];
  27.   resul: string[20];
  28.   prav: string;
  29.  
  30. procedure stolknovenie;
  31. var
  32.   i: integer;
  33. begin
  34.   for i := 2 to d - 2 do
  35.   begin
  36.     if (Xz[i] = Xz[i + 2]) and (Yz[i] = Yz[i + 2]) then
  37.       es := 0 else es := 1;
  38.     sa := sa * es;
  39.   end;
  40.   for i := 1 to d - 3 do
  41.   begin
  42.     if (sa <> 0) and (xz[1] = xz[i + 3]) and (yz[1] = yz[i + 3]) then Play := 0;
  43.   end;
  44.   if (Xz[1] = 3) or (Xz[1] = 57) or (Yz[1] = 3) or (Yz[1] = 22) Then Play := 0;
  45. end;
  46.  
  47. procedure Ramka(Xr, Yr: Byte; tt: string; c: byte);
  48. var
  49.   i: integer;
  50. begin
  51.   TextColor(c);
  52.   GotoXY(Xr, Yr + 1);
  53.   write(tt);
  54.   for i := Xr to Xr + 20 do
  55.   begin
  56.     GotoXY(i, Yr);
  57.     write('*');
  58.     GotoXY(i, Yr + 2);
  59.     write('*');
  60.   end;
  61.   for i := Yr to Yr + 2 do
  62.   begin
  63.     GotoXY(Xr, i);
  64.     write('*');
  65.     GotoXY(Xr + 20, i);
  66.     write('*');
  67.   end;
  68. end;
  69.  
  70. procedure Izm(vv: byte);
  71. begin
  72.   Ax := Bx; Ay := By;
  73.   Bx := Xz[vv]; By := Yz[vv];
  74.   Xz[vv] := Ax; Yz[vv] := Ay;
  75. end;
  76.  
  77. procedure menu2(q, qq, wq, qw: string);
  78. var
  79.   X1, Y1: integer;
  80. begin
  81.   Clrscr;
  82.   TextBackground(0);
  83.   TextColor(15);
  84.   for X1 := 25 to 55 do
  85.   begin
  86.     GotoXY(X1, 4);
  87.     Write('*');
  88.     GotoXY(X1, 22);
  89.     Write('*');
  90.   end;
  91.   for Y1 := 4 to 22 do
  92.   begin
  93.     GotoXY(25, Y1);
  94.     Write('*');
  95.     GotoXY(55, Y1);
  96.     Write('*');
  97.   end;
  98.   GotoXY(31, 7);
  99.   Write(q);
  100.   K2 := 0;
  101.   repeat
  102.     K2 := k2 + kk;
  103.     kk := 0;
  104.     if k2 = 0 Then Ramka(30, 10, qq, 128) else
  105.       Ramka(30, 10, qq, 15);
  106.     if k2 = 1 then Ramka(30, 14, wq, 128) else
  107.       Ramka(30, 14, wq, 15);
  108.     if K2 = 2 Then Ramka(30, 18, qw, 128) else
  109.       Ramka(30, 18, qw, 15);
  110.     Kno := ReadKey;
  111.     if Kno = #80 then begin if k2 < 2 then kk := 1 else kk := 0; end else
  112.     if Kno = #72 then begin if k2 > 0 then kk := -1 else kk := 0; end;
  113.   until Kno = chr(13);
  114. end;
  115.  
  116. procedure Spravka;
  117. var
  118.   i, X1, Y1: Integer;
  119. begin
  120.   menu2('      СПРАВКА', '     ПРАВИЛА ИГРЫ   ', '     РАЗРАБОТЧИК    ', '        НАЗАД       ');
  121.   if k2 = 0 then
  122.   begin
  123.     clrscr;
  124.     assign(f4, 'd:\kkk\pravila.pas');
  125.     reset(f4);
  126.     i := 3;
  127.     while not EOF(f4) do
  128.     begin
  129.       GotoXY(3, i);
  130.       i := i + 2;
  131.       readln(f4, prav);
  132.       writeln(prav);
  133.     end;
  134.     readln;
  135.   end;
  136.   if k2 = 1 then
  137.   begin
  138.     clrscr;
  139.     TextBackground(0);
  140.     TextColor(4);
  141.     for X1 := 3 to 77 do
  142.     begin
  143.       GotoXY(x1, 2);
  144.       Write('*');
  145.       GotoXY(X1, 23);
  146.       write('*');
  147.     end;
  148.     for Y1 := 2 to 23 do
  149.     begin
  150.       GotoXY(3, Y1);
  151.       Write('*');
  152.       GotoXY(77, y1);
  153.       Write('*');
  154.     end;
  155.     assign(f4, 'd:\kkk\avtor.pas');
  156.     reset(f4);
  157.     d := 7;
  158.     while not EOF(f4) do
  159.     begin
  160.       textcolor(10);
  161.       readln(f4, prav);
  162.       GotoXY(19, d);
  163.       Write(prav);
  164.       d := d + 2;
  165.       for i := 1 to 4 do
  166.         Delay(59000);
  167.     end;
  168.     close(f4);
  169.     readln;
  170.   end;
  171.   if k2 = 2 then
  172.     TextBackground(0);
  173.   textcolor(15);
  174. end;
  175.  
  176. procedure Resultat;
  177. var
  178.   i, j: integer;
  179. begin
  180.   clrscr;
  181.   reset(f1);
  182.   for i := 1 to 10 do
  183.   begin
  184.     readln(f1, us[i].name);
  185.   end;
  186.   close(f1);
  187.   reset(f2);
  188.   for i := 1 to 10 do
  189.     read(f2, us[i].resultat);
  190.   close(f2);
  191.   gotoXy(25, 12);
  192.   if schot > us[10].resultat then
  193.   begin
  194.     writeln('Ваш результат составил: ', schot);
  195.     gotoxy(30, 13);
  196.     writeln('Введите ваше имя...');
  197.     gotoxy(36, 14);
  198.     read(namen);
  199.   end
  200.   else
  201.   begin
  202.     GotoXY(23, 13);
  203.     writeln('Вы не побили самый худший результат!!! :(');
  204.     GotoXY(13, 14);
  205.     writeln('Но не огорчайтесь!!! Вы можете просто написать ваше имя!!!)))');
  206.     GotoXY(36, 15);
  207.     readln(namen);
  208.   end;
  209.   us[11].name := namen;
  210.   us[11].resultat := schot;
  211.   for i := 1 to 11 do
  212.     for j := 2 to 11 do
  213.     begin
  214.       if us[j].resultat > us[j - 1].resultat then
  215.       begin
  216.         aa := us[j - 1];
  217.         us[j - 1] := us[j];
  218.         us[j] := aa;
  219.       end;
  220.     end;
  221.   rewrite(f1);
  222.   for i := 1 to 10 do
  223.   begin
  224.     write(f1, us[i].name);
  225.     writeln(f1, ' ');
  226.   end;
  227.   close(f1);
  228.   rewrite(f2);
  229.   for i := 1 to 10 do
  230.     write(f2, us[i].resultat);
  231.   close(f2);
  232.   rewrite(f3);
  233.   for i := 1 to 10 do
  234.     writeln(f3, i, ':  ', us[i].resultat, '  ', us[i].name);
  235.   close(f3);
  236. end;
  237.  
  238. begin
  239.   assign(f3, 'd:\kkk\itog.txt');
  240.   assign(f1, 'd:\kkk\imena.txt');
  241.   assign(f2, 'd:\kkk\rec.dat');
  242.   repeat
  243.     repeat
  244.       Clrscr;
  245.       TextBackground(0);
  246.       TextColor(15);
  247.       for X1 := 25 to 55 do
  248.       begin
  249.         GotoXY(X1, 4);
  250.         Write('*');
  251.         GotoXY(X1, 22);
  252.         Write('*');
  253.       end;
  254.       for Y1 := 4 to 22 do
  255.       begin
  256.         GotoXY(25, Y1);
  257.         Write('*');
  258.         GotoXY(55, Y1);
  259.         Write('*');
  260.       end;
  261.       K := 0;
  262.       repeat
  263.         k := k + kk;
  264.         kk := 0;
  265.         if k = 0 Then Ramka(30, 6, '        ИГРАТЬ       ', 128) else
  266.           Ramka(30, 6, '        ИГРАТЬ       ', 15);
  267.         if k = 1 Then Ramka(30, 10, '       РЕКОРДЫ      ', 128) else
  268.           Ramka(30, 10, '       РЕКОРДЫ       ', 15);
  269.         if k = 2 then Ramka(30, 14, '       СПРАВКА       ', 128) else
  270.           Ramka(30, 14, '       СПРАВКА       ', 15);
  271.         if k = 3 then Ramka(30, 18, '        ВЫХОД        ', 128) else
  272.           Ramka(30, 18, '        ВЫХОД       ', 15);
  273.         Kno := ReadKey;
  274.         if Kno = #80 then begin if k < 3 then kk := 1 else kk := 0; end else
  275.         if Kno = #72 then begin if k > 0 then kk := -1 else kk := 0; end;
  276.       until Kno = chr(13);
  277.       if k = 1 then
  278.       begin
  279.         Clrscr;
  280.         GotoXy(36, 5);
  281.         writeln('РЕКОРДЫ');
  282.         reset(f3);
  283.         for i := 1 to 10 do
  284.         begin
  285.           readln(f3, resul);
  286.           GotoXY(32, 7 + i);
  287.           Write(resul);
  288.         end;
  289.         close(f3);
  290.         Readln;
  291.       end;
  292.       if k = 2 then
  293.         repeat
  294.           spravka;
  295.         until k2 = 2;
  296.       if k = 3 then
  297.         exit;
  298.     until (k = 3) or (k = 0);
  299.     if k = 0 then begin
  300.       menu2('  УРОВЕНЬ СЛОЖНОСТИ', '        ГЛИСТ       ', '        ЗМЕЯ        ', '       АНАКОНДА     ');
  301.     end;
  302.     if K2 = 0 then begin Sl := 40000; och := 25; d := 5 end else if k2 = 1 then begin
  303.       Sl := 30000; och := 50; d := 10 end else begin Sl := 20000; och := 100; d := 15 end;
  304.     TextBackground(1);
  305.     Textcolor(5);
  306.     clrscr;
  307.     schot := 0; playE := 1;
  308.     Xz[1] := 30;
  309.     Yz[1] := 13;
  310.     for i := 2 to 40 do
  311.     begin
  312.       Xz[i] := Xz[1];
  313.       Yz[i] := Yz[1];
  314.     end;
  315.     for X1 := 3 to 57 do
  316.     begin
  317.       GotoXY(x1, 2);
  318.       Write('*');
  319.       GotoXY(X1, 23);
  320.       write('*');
  321.     end;
  322.     for Y1 := 2 to 23 do
  323.     begin
  324.       GotoXY(3, Y1);
  325.       Write('*');
  326.       GotoXY(57, y1);
  327.       Write('*');
  328.     end;
  329.     Play := 1;
  330.     GotoXY(60, 4);
  331.     write('СЧЕТ: ');
  332.     GotoXY(60, 6);
  333.     write('Рост змеи: ');
  334.     gotoXY(60, 8);
  335.     write('Лучшие результаты:');
  336.     reset(f3);
  337.     for i := 1 to 3 do
  338.     begin
  339.       readln(f3, resul);
  340.       GotoXY(60, 9 + i);
  341.       Write(resul);
  342.     end;
  343.     close(f3);
  344.     repeat
  345.       if play = 1 then begin
  346.         TextColor(4);
  347.         Ax := xz[1]; Ay := Yz[1];
  348.         Xz[1] := Xz[1] + H; Yz[1] := Yz[1] + W;
  349.         Bx := Xz[2]; By := Yz[2];
  350.         Xz[2] := Ax; Yz[2] := Ay;
  351.         for i := 3 to 40 do
  352.           izm(i);
  353.         GotoXY(Xz[1], Yz[1]);
  354.         write(chr(1));
  355.         for i := 2 to d do
  356.         begin
  357.           GotoXY(Xz[i], Yz[i]);
  358.           Write(chr(4));
  359.         end;
  360.         Delay(SL);
  361.         Textcolor(1);
  362.         GotoXY(Xz[1], Yz[1]);
  363.         write(chr(1));
  364.         for i := 2 to 40 do
  365.         begin
  366.           GotoXY(Xz[i], Yz[i]);
  367.           Write(chr(4));
  368.         end;
  369.         randomize;
  370.         if PlayE = 1 then
  371.         begin
  372.           Ex := Random(54) + 4;
  373.           Ey := random(18) + 4;
  374.           if (K2 = 0) and (schot <> 0) and ((schot mod 75) = 0) then
  375.             d := d + 1;
  376.           if (k2 = 0) and (schot <> 0) and ((schot mod 150) = 0) then
  377.             Sl := Sl - 500;
  378.           if (K2 = 1) and (schot <> 0) and ((schot mod 150) = 0) then
  379.             d := d + 1;
  380.           if (k2 = 1) and (schot <> 0) and ((schot mod 500) = 0) then
  381.             Sl := Sl - 500;
  382.           if (K2 = 2) and (schot <> 0) and ((schot mod 500) = 0) then
  383.             d := d + 1;
  384.           if (k2 = 2) and (schot <> 0) and ((schot mod 1000) = 0) then
  385.             Sl := Sl - 500;
  386.           PlayE := 0; end;
  387.         Textcolor(6);
  388.         GotoXY(Ex, Ey);
  389.         write(chr(6));
  390.         if (Xz[1] = Ex) and (Yz[1] = Ey) then
  391.         begin
  392.           schot := schot + och;
  393.           PlayE := 1;
  394.           Textcolor(1);
  395.           GotoXy(Ex, Ey);
  396.           write(' ');
  397.         end;
  398.         case Kno of
  399.           #72: begin W := -1; H := 0;  end;
  400.           #80: begin W := 1; H := 0;  end;
  401.           #77: begin W := 0; H := 1;  end;
  402.           #75: begin W := 0; h := -1; end;
  403.         end;
  404.         if Keypressed = true then begin onk := readkey;Kno := Readkey; end;
  405.       end;
  406.       GotoXY(66, 4);
  407.       write(Schot);
  408.       GotoXY(70, 6);
  409.       write(d);
  410.       sa := 10;
  411.       stolknovenie;
  412.     until Play = 0;
  413.     if play = 0 then begin
  414.       TextBackground(0);
  415.       Textcolor(15);
  416.       clrscr;
  417.       GotoXY(6, 8);
  418.       write(' *****   *****  *       * *******      *****  **   ** ******* ****** ');
  419.       GotoXY(6, 9);
  420.       write('******* ******* **     ** *******     ******* **   ** ******* *******');
  421.       GotoXY(6, 10);
  422.       write('**      **   ** ***   *** **          **   ** **   ** **      **   **');
  423.       GotoXY(6, 11);
  424.       write('**      **   ** **** **** **          **   ** **   ** **      **   **');
  425.       GotoXY(6, 12);
  426.       write('**      **   ** ** *** ** ****        **   ** **   ** ****    **   **');
  427.       GotoXY(6, 13);
  428.       write('**  **  ******* **  *  ** ****        **   ** **   ** ****    ****** ');
  429.       GotoXY(6, 14);
  430.       write('**  *** ******* **     ** **          **   ** **   ** **      ****   ');
  431.       GotoXY(6, 15);
  432.       write('**   ** **   ** **     ** **          **   **  ** **  **      ** **  ');
  433.       GotoXY(6, 16);
  434.       write('******* **   ** **     ** *******     *******   ***   ******* **  ** ');
  435.       GotoXY(6, 17);
  436.       write(' *****  **   ** **     ** *******      *****     *    ******* **   **');
  437.       GotoXY(25, 23);
  438.       Write('Для продолжения нажмите ENTER');
  439.       repeat
  440.         kno := readkey;
  441.       until Kno = chr(13);
  442.     end;
  443.     resultat;
  444.     H := 0; w := 0; k := 0; kk := 0;
  445.   until k = 3; end.

ИИ поможет Вам:


  • решить любую задачу по программированию
  • объяснить код
  • расставить комментарии в коде
  • и т.д
Попробуйте бесплатно

Оцени полезность:

9   голосов , оценка 3.778 из 5

Нужна аналогичная работа?

Оформи быстрый заказ и узнай стоимость

Бесплатно
Оформите заказ и авторы начнут откликаться уже через 10 минут
Похожие ответы