1. Pascal / Говнокод #9068

    +105

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    program tetris;
    uses
      crt;
    var
      ss,nn,x,y,pus,a,b,c,d,lin,rlin:integer;
      st:array[1..12] of array[1..22] of integer;
    
    procedure k(x,y:integer);
    {ђЁб㥬 Єў а¤а вЁЄ}
    begin
     gotoxy(x*2+27,25-y);
     if ss=0 then write('  ');
     if ss=1 then write('[]');
     if ss=2 then write(chr(177),chr(177));
     if (ss=3) and (st[x,y]>0) then pus:=1;
     if ss=4 then st[x,y]:=1;
     gotoxy(1,1);write(' ');
    end;
    
    procedure fig(x,y,n,s:integer);
    {ђЁб㥬 дЁЈгаг}
    begin
     if s=3 then pus:=0;
     ss:=s; k(x,y);
     if n=1 then begin k(x+1,y);k(x,y-1);k(x+1,y-1) end;
     if n=2 then begin k(x-1,y);k(x+1,y);k(x+2,y) end;
     if n=3 then begin k(x,y+1);k(x,y-1);k(x,y-2) end;
     if n=4 then begin k(x+1,y);k(x-1,y);k(x-1,y+1) end;
     if n=5 then begin k(x,y+1);k(x+1,y+1);k(x,y-1) end;
     if n=6 then begin k(x-1,y);k(x+1,y);k(x+1,y-1) end;
     if n=7 then begin k(x,y+1);k(x,y-1);k(x-1,y-1) end;
     if n=8 then begin k(x-1,y);k(x+1,y);k(x+1,y+1) end;
     if n=9 then begin k(x,y+1);k(x,y-1);k(x+1,y-1) end;
     if n=10 then begin k(x+1,y);k(x-1,y);k(x-1,y-1) end;
     if n=11 then begin k(x,y+1);k(x,y-1);k(x-1,y+1) end;
     if n=12 then begin k(x-1,y);k(x,y-1);k(x+1,y-1) end;
     if n=13 then begin k(x,y+1);k(x-1,y);k(x-1,y-1) end;
     if n=14 then begin k(x+1,y);k(x-1,y-1);k(x,y-1) end;
     if n=15 then begin k(x-1,y);k(x,y-1);k(x-1,y+1) end;
     if n=16 then begin k(x+1,y);k(x-1,y);k(x,y+1) end;
     if n=17 then begin k(x+1,y);k(x,y+1);k(x,y-1) end;
     if n=18 then begin k(x,y-1);k(x-1,y);k(x+1,y) end;
     if n=19 then begin k(x-1,y);k(x,y+1);k(x,y-1) end
    end;
    
    procedure pov;
    {Џ®ў®а®в дЁЈгал}
    begin
     nn:=nn-1;
     if nn=15 then nn:=19;
     if nn=13 then nn:=15;
     if nn=11 then nn:=13;
     if nn=7 then nn:=11;
     if nn=3 then nn:=7;
     if nn=1 then nn:=3;
     if nn=0 then nn:=1;
    end;
    
    procedure clrst;
    {ЋзЁбвЄ  бв Є ­ }
    begin
     for x:=1 to 12 do
      for y:=1 to 22 do
       if (x=1) or (x=12) or (y=1) then st[x,y]:=2 else st[x,y]:=0;
    end;
    
    procedure risvesst;
    {ђЁб®ў вм ўҐбм бв Є ­}
    begin
     for x:=1 to 12 do  for y:=1 to 22 do
       begin
        ss:=st[x,y];
        k(x,y)
       end;
    end;
    
    procedure dvig;
    {„ўЁ¦Ґ­ЁҐ}
    var
     i:integer;key:char;
    begin
     for i:=1 to 10 do
      begin
      delay(d);
      key:=' ';
      if keypressed then key:=readkey;
      if key='i' then
       begin
       fig(x-1,y,nn,3);
       if pus=0 then begin fig(x,y,nn,0); x:=x-1; fig(x,y,nn,1); end;
       end;

    http://sources.ru/pascal/gamestxt/tet.htm

    Запостил: dos_, 10 Января 2012

    Комментарии (10) RSS

    Добавить комментарий