daily pastebin goal
83%
SHARE
TWEET

LIVE.PAS

tolikpunkoff Mar 18th, 2018 30 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program _ ;
  2. Uses Crt;
  3. var
  4.    _Pole1:Array [ 0..101 , 0..101 ] of byte;
  5.    _Pole2:Array [ 0..101 , 0..101 ] of byte;
  6.    _X,_Y,__X,__Y,_I,_J,__i:byte;
  7.    _A:char;
  8.  
  9.  
  10. begin
  11. For _J:=0 to 101 do
  12. For _I:=0 to 50 do begin
  13. _Pole1[_I*2+1,_j]:=0;_Pole2[_I*2+1,_j]:=0;_Pole1[_I*2,_j]:=0;_Pole2[_I*2,_j]:=0;
  14. end;
  15. _X:=1;_Y:=1;_A:=#0;__X:=0;__Y:=0;
  16. while _A<>#27  do
  17. begin
  18. _A:=readkey;
  19. if _A=#60 Then
  20. begin
  21. while not keypressed do
  22. BEGIN
  23. delay (3000);
  24. FOR _I:=1 to 100 do
  25. for _J:=1 to 100 do
  26. begin
  27. if 3=_pole1[_i-1,_j-1]
  28. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  29. then _Pole2[_I,_J]:=1;
  30. if 4<=_pole1[_i-1,_j-1]
  31. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  32. then _Pole2[_I,_J]:=0;
  33. if 1>=_pole1[_i-1,_j-1]
  34. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  35. then _Pole2[_I,_J]:=0;
  36. if 2=_pole1[_i-1,_j-1]
  37. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  38. then _Pole2[_I,_J]:=_Pole1[_I,_J];
  39. end;
  40. FOR _I:=1 to 100 do
  41. for _J:=1 to 100 do
  42. begin
  43. _Pole1[_I,_J]:=_Pole2[_I,_J];
  44. end;
  45. For _I:=__X+1 to __X+50 do
  46. For _J:=__Y+1 to __Y+25 do
  47. begin
  48. textbackground(1);
  49. textcolor(7);
  50. gotoxy(_I-__X,_J-__Y);
  51. if (_I=_X)and(_J=_Y) then begin
  52.                                textbackground(7);
  53.                                textcolor(1);
  54.                                end;
  55. if _Pole1[_I,_J]=0 then Write(#178) else Write(#245);
  56. end;
  57. for _I:=1 to 24 do begin gotoxy(51,_I); WRITE('                              '); end;
  58. gotoxy(51,1); WRITE(' _X=',_X,' __X=',__X);
  59. gotoxy(51,3); WRITE(' _Y=',_Y,' __Y=',__Y);
  60. gotoxy(51,5); WRITE(' Очистить все    F1');
  61. gotoxy(51,7); WRITE(' жизнь до клавиши F2');
  62.  
  63. end;
  64.  
  65. end;
  66.  
  67. if _A=#59 Then
  68. begin
  69. For _J:=0 to 101 do
  70. For _I:=0 to 50 do begin
  71. _Pole1[_I*2+1,_j]:=0;_Pole2[_I*2+1,_j]:=0;_Pole1[_I*2,_j]:=0;_Pole2[_I*2,_j]:=0;
  72. end;
  73. end;
  74.  
  75. if _A=#77 Then _X:=_X+1;
  76. if _A=#75 Then _X:=_X-1;
  77. if _A=#80 Then _Y:=_Y+1;
  78. if _A=#72 Then _Y:=_Y-1;
  79. if _A=#32 Then If _Pole1[_X,_Y]=0 then _Pole1[_X,_Y]:=1 else _Pole1[_X,_Y]:=0;
  80. if _A=#13 Then
  81. BEGIN
  82. FOR _I:=1 to 100 do
  83. for _J:=1 to 100 do
  84. begin
  85. if 3=_pole1[_i-1,_j-1]
  86. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  87. then _Pole2[_I,_J]:=1;
  88. if 4<=_pole1[_i-1,_j-1]
  89. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  90. then _Pole2[_I,_J]:=0;
  91. if 1>=_pole1[_i-1,_j-1]
  92. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  93. then _Pole2[_I,_J]:=0;
  94. if 2=_pole1[_i-1,_j-1]
  95. +_pole1[_i,_j-1]+_pole1[_i+1,_j-1]+_pole1[_i-1,_j]+_pole1[_i+1,_j]+_pole1[_i-1,_j+1]+_pole1[_i,_j+1]+_pole1[_i+1,_j+1]
  96. then _Pole2[_I,_J]:=_Pole1[_I,_J];
  97. end;
  98. FOR _I:=1 to 100 do
  99. for _J:=1 to 100 do
  100. begin
  101. _Pole1[_I,_J]:=_Pole2[_I,_J];
  102. end;
  103.  
  104. END;
  105.  
  106. if _X<1   then _x:=1   ;
  107. if _X>100 then _X:=100 ;
  108. if _Y<1   then _Y:=1   ;
  109. if _Y>100 then _Y:=100 ;
  110.  
  111. if (_Y<=__Y)AND(_Y>0)    then __Y:=__Y-1  ;
  112. if (_Y>__Y+25)and(_Y<=100) then __Y:=__Y+1  ;
  113. if __Y<0   then __Y:=0   ;
  114. if __Y>76 then __Y:=76 ;
  115. if (_X<=__X)AND(_X>0)    then __X:=__X-1  ;
  116. if (_X>__X+50)and(_X<=100) then __X:=__X+1  ;
  117. if __X<0   then __X:=0   ;
  118. if __X>51 then __X:=76 ;
  119.  
  120.  
  121. For _I:=__X+1 to __X+50 do
  122. For _J:=__Y+1 to __Y+25 do
  123. begin
  124. textbackground(1);
  125. textcolor(7);
  126. gotoxy(_I-__X,_J-__Y);
  127. if (_I=_X)and(_J=_Y) then begin
  128.                                textbackground(7);
  129.                                textcolor(1);
  130.                                end;
  131. if _Pole1[_I,_J]=0 then Write(#178) else Write(#245);
  132. end;
  133. for _I:=1 to 24 do begin gotoxy(51,_I); WRITE('                              '); end;
  134. gotoxy(51,1); WRITE(' _X=',_X,' __X=',__X);
  135. gotoxy(51,3); WRITE(' _Y=',_Y,' __Y=',__Y);
  136. gotoxy(51,5); WRITE(' Очистить все    F1');
  137. gotoxy(51,7); WRITE(' жизнь до клавиши F2');
  138.  
  139.  
  140.  
  141.  
  142. end;
  143. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top