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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    case ((((parametr[3, 1] - parametr[1, 1]) / parametr[4, 2] = (parametr[3, 2] - parametr[1, 2]) / parametr[4, 2]) and ((parametr[3, 2] - parametr[1, 2]) / parametr[4, 2] = (parametr[3, 3] - parametr[1, 3]) / parametr[4, 3])) xor           
                ((parametr[4, 1] = 0) and (parametr[1, 1] = parametr[2, 1]) and (parametr[2, 1] = parametr[3, 1]) and ((parametr[3, 2] - parametr[1, 2]) / parametr[4, 2] = (parametr[3, 3] - parametr[1, 3]) / parametr[4, 3])) xor          
                 ((parametr[4, 2] = 0) and (parametr[1, 2] = parametr[2, 2]) and (parametr[2, 2] = parametr[3, 2]) and ((parametr[3, 1] - parametr[1, 1]) / parametr[4, 1] = (parametr[3, 3] - parametr[1, 3]) / parametr[4, 3])) xor                           
                    ((parametr[4, 3] = 0) and (parametr[1, 3] = parametr[2, 3]) and (parametr[2, 3] = parametr[3, 3]) and ((parametr[3, 1] - parametr[1, 1]) / parametr[4, 1] = (parametr[3, 2] - parametr[1, 2]) / parametr[4, 2])) xor             
                       ((parametr[4, 3] <> 0) and (parametr[4, 1] = 0) and (parametr[4, 2] = 0) and (parametr[3, 1] = parametr[2, 1]) and (parametr[3, 2] = parametr[2, 2])) xor                    
                          ((parametr[4, 2] <> 0) and (parametr[4, 1] = 0) and (parametr[4, 3] = 0) and (parametr[3, 1] = parametr[2, 1]) and (parametr[3, 3] = parametr[2, 3])) xor                       
                             ((parametr[4, 1] <> 0) and (parametr[4, 2] = 0) and (parametr[4, 3] = 0) and (parametr[3, 2] = parametr[2, 2]) and (parametr[3, 3] = parametr[2, 3])) xor                         
                                ((parametr[4, 1] = 0) and (parametr[4, 2] = 0) and (parametr[4, 3] = 0))) of true:
             writeln('Все точки лежат на одной прямой. Такой треугольник не существует.');

    Проверка треугольника в декартовой системе координат

    Meliodas, 04 Октября 2015

    Комментарии (10)
  2. Pascal / Говнокод #18756

    +5

    1. 1
    Commission:= Commission/100*StrToInt(Label8.Caption); //Вычисление комиссии

    Терминальщики :|

    Dego1n, 23 Сентября 2015

    Комментарии (9)
  3. Pascal / Говнокод #18614

    +4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    with TfmVersionUpdate.Create(Application) do
    begin
      try
        Init;
      except
      end;
      Free;
    end;

    Такой код 100500% отработает без ошибок. Зачем вообще сообщения о них выводить...

    kiryl, 19 Августа 2015

    Комментарии (21)
  4. Pascal / Говнокод #18566

    +1000

    1. 1
    2. 2
    3. 3
    4. 4
    procedure PP.Execute;
    begin inherited;
    (Sender as TIndusImage).KOT;
    end;

    В Delphi XE, не знаю с какой версии начиная (в XE7 и XE8 точно) крупные проблемы с TGifImage, а если точнее - если быстро и много их менять, то рано или поздно вываливается тупо всё вместе с интерфейсом (100% где-то в потоках налажали), причем если быстро менять BMP, то всё ОК.

    Пришла в голову идея в потоке самому менять кадры анимации, подгружая их как BMP, и дабы затестить сработает ли вообще, начал писать тестовую прогу.

    Писал особо не заботясь ни о чем, а потом заметил вот таких индусских котов.

    KOTOM, 03 Августа 2015

    Комментарии (20)
  5. Pascal / Говнокод #18547

    +7

    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
    function variant (x0, y0, x1, y1, x2, y2, x3, y3:real):integer;
    begin
        if (x0<=x1) and (y0<=y1) and (x1<=x2) and (y1<=y2) and (x2<=x3) and (y2<=y3) or
           (x0>=x1) and (y0<=y1) and (x1>=x2) and (y1<=y2) and (x2>=x3) and (y2<=y3) or
           (x0>=x1) and (y0>=y1) and (x1>=x2) and (y1>=y2) and (x2>=x3) and (y2>=y3) or
           (x0>=x1) and (y0<=y1) and (x1>=x2) and (y1<=y2) and (x2>=x3) and (y2<=y3) then variant:=1;
        if (x0<=x1) and (y0<=y1) and (x1<=x3) and (y1<=y3) and (x3<=x2) and (y3<=y2) or
           (x0>=x1) and (y0<=y1) and (x1>=x3) and (y1<=y3) and (x3>=x2) and (y3<=y2) or
           (x0>=x1) and (y0>=y1) and (x1>=x3) and (y1>=y3) and (x3>=x2) and (y3>=y2) or
           (x0>=x1) and (y0<=y1) and (x1>=x3) and (y1<=y3) and (x3>=x2) and (y3<=y2) then variant:=2;
        if (x1<=x0) and (y1<=y0) and (x0<=x2) and (y0<=y2) and (x2<=x3) and (y2<=y3) or
           (x1>=x0) and (y1<=y0) and (x0>=x2) and (y0<=y2) and (x2>=x3) and (y2<=y3) or
           (x1>=x0) and (y1>=y0) and (x0>=x2) and (y0>=y2) and (x2>=x3) and (y2>=y3) or
           (x1>=x0) and (y1<=y0) and (x0>=x2) and (y0<=y2) and (x2>=x3) and (y2<=y3) then variant:=3;
        if (x1<=x0) and (y1<=y0) and (x0<=x3) and (y0<=y3) and (x3<=x2) and (y3<=y2) or
           (x1>=x0) and (y1<=y0) and (x0>=x3) and (y0<=y3) and (x3>=x2) and (y3<=y2) or
           (x1>=x0) and (y1>=y0) and (x0>=x3) and (y0>=y3) and (x3>=x2) and (y3>=y2) or
           (x1>=x0) and (y1<=y0) and (x0>=x3) and (y0<=y3) and (x3>=x2) and (y3<=y2) then variant:=4;
        if (x0<=x3) and (y0<=y3) and (x3<=x1) and (y3<=y1) and (x1<=x2) and (y1<=y2) or
           (x0>=x3) and (y0<=y3) and (x3>=x1) and (y3<=y1) and (x1>=x2) and (y1<=y2) or
           (x0>=x3) and (y0>=y3) and (x3>=x1) and (y3>=y1) and (x1>=x2) and (y1>=y2) or
           (x0>=x3) and (y0<=y3) and (x3>=x1) and (y3<=y1) and (x1>=x2) and (y1<=y2) then variant:=5;
        if (x0<=x3) and (y0<=y3) and (x3<=x2) and (y3<=y2) and (x2<=x1) and (y2<=y1) or
           (x0>=x3) and (y0<=y3) and (x3>=x2) and (y3<=y2) and (x2>=x1) and (y2<=y1) or
           (x0>=x3) and (y0>=y3) and (x3>=x2) and (y3>=y2) and (x2>=x1) and (y2>=y1) or
           (x0>=x3) and (y0<=y3) and (x3>=x2) and (y3<=y2) and (x2>=x1) and (y2<=y1) then variant:=6;
        if (x0<=x2) and (y0<=y2) and (x2<=x1) and (y2<=y1) and (x1<=x3) and (y1<=y3) or
           (x0>=x2) and (y0<=y2) and (x2>=x1) and (y2<=y1) and (x1>=x3) and (y1<=y3) or
           (x0>=x2) and (y0>=y2) and (x2>=x1) and (y2>=y1) and (x1>=x3) and (y1>=y3) or
           (x0>=x2) and (y0<=y2) and (x2>=x1) and (y2<=y1) and (x1>=x3) and (y1<=y3) then variant:=7;
        if (x0<=x2) and (y0<=y2) and (x2<=x3) and (y2<=y3) and (x3<=x1) and (y3<=y1) or
           (x0>=x2) and (y0<=y2) and (x2>=x3) and (y2<=y3) and (x3>=x1) and (y3<=y1) or
           (x0>=x2) and (y0>=y2) and (x2>=x3) and (y2>=y3) and (x3>=x1) and (y3>=y1) or
           (x0>=x2) and (y0<=y2) and (x2>=x3) and (y2<=y3) and (x3>=x1) and (y3<=y1) then variant:=8;
        if (x1<=x2) and (y1<=y2) and (x2<=x0) and (y2<=y0) and (x0<=x3) and (y0<=y3) or
           (x1>=x2) and (y1<=y2) and (x2>=x0) and (y2<=y0) and (x0>=x3) and (y0<=y3) or
           (x1>=x2) and (y1>=y2) and (x2>=x0) and (y2>=y0) and (x0>=x3) and (y0>=y3) or
           (x1>=x2) and (y1<=y2) and (x2>=x0) and (y2<=y0) and (x0>=x3) and (y0<=y3) then variant:=9;
        if (x1<=x3) and (y1<=y3) and (x3<=x0) and (y3<=y0) and (x0<=x2) and (y0<=y2) or
           (x1>=x3) and (y1<=y3) and (x3>=x0) and (y3<=y0) and (x0>=x2) and (y0<=y2) or
           (x1>=x3) and (y1>=y3) and (x3>=x0) and (y3>=y0) and (x0>=x2) and (y0>=y2) or
           (x1>=x3) and (y1<=y3) and (x3>=x0) and (y3<=y0) and (x0>=x2) and (y0<=y2) then variant:=10;
        if (x2<=x0) and (y2<=y0) and (x0<=x1) and (y0<=y1) and (x1<=x3) and (y1<=y3) or
           (x2>=x0) and (y2<=y0) and (x0>=x1) and (y0<=y1) and (x1>=x3) and (y1<=y3) or
           (x2>=x0) and (y2>=y0) and (x0>=x1) and (y0>=y1) and (x1>=x3) and (y1>=y3) or
           (x2>=x0) and (y2<=y0) and (x0>=x1) and (y0<=y1) and (x1>=x3) and (y1<=y3) then variant:=11;
        if (x2<=x1) and (y2<=y1) and (x1<=x0) and (y1<=y0) and (x0<=x3) and (y0<=y3) or
           (x2>=x1) and (y2<=y1) and (x1>=x0) and (y1<=y0) and (x0>=x3) and (y0<=y3) or
           (x2>=x1) and (y2>=y1) and (x1>=x0) and (y1>=y0) and (x0>=x3) and (y0>=y3) or
           (x2>=x1) and (y2<=y1) and (x1>=x0) and (y1<=y0) and (x0>=x3) and (y0<=y3) then variant:=12;
    end;

    Источник: http://e-olimp.blogspot.com/2013/08/12.html

    Felytic, 29 Июля 2015

    Комментарии (1)
  6. Pascal / Говнокод #18330

    +139

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    s:=0; k:=1;
    while s<200 do begin
    s:=s+3*k;
    end;
    if s<200 then begin
    k:=k+1;
    end;

    Ничего такого..

    MaxLevs, 11 Июня 2015

    Комментарии (3)
  7. Pascal / Говнокод #18296

    +144

    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
    Unit Web;
    
    interface
    
    uses System, System.Drawing, System.Windows.Forms;
    
    var f: Form;
    
    type
      WebBro = class(Form)
        procedure button1_Click(sender: Object; e: EventArgs);
      {$region FormDesigner}
      private
        {$resource Web.WebBro.resources}
        button1: Button;
        webBrowser1: WebBrowser;
        {$include Web.WebBro.inc}
      {$endregion FormDesigner}
      public
        constructor;
        begin
          InitializeComponent;
        end;
      end;
    
    implementation
    
    Procedure FindForm();
    begin
      var i:=0;
      while i < Application.OpenForms.Count do
        begin
          f := Application.OpenForms.Item[i];
          if f.Name = 'TwiGen_News' then exit
            else inc(i);
        end;
    end;
    
    procedure WebBro.button1_Click(sender: Object; e: EventArgs);
    begin
      WebBro.ActiveForm.Hide();
      FindForm;
      f.Show();
    end;
    
    end.
    
    //----------------
    
    Unit Unit1;
    
    interface
    
    uses System, System.Drawing, System.Windows.Forms, Web;
    
    var NewsForm: WebBro;
    
    type
      TwiGen_News = class(Form)
        procedure News_Click(sender: Object; e: EventArgs);
      {$region FormDesigner}
      private
        {$resource Unit1.TwiGen_News.resources}
        LogIn: Button;
        News: Button;
        Reg: Button;
        {$include Unit1.TwiGen_News.inc}
      {$endregion FormDesigner}
      public
        constructor;
        begin
          InitializeComponent;
        end;
      end;
    
    implementation
    
    procedure TwiGen_News.News_Click(sender: Object; e: EventArgs);
    begin
      TwiGen_News.ActiveForm.Hide();
      NewsForm := new WebBro;
      NewsForm.Show;
    end;
    
    end.

    Друг писал, но мне он говорил, что переписывал говнокод.
    Pascal ABC.NET.

    Janycz, 08 Июня 2015

    Комментарии (9)
  8. Pascal / Говнокод #18294

    +142

    1. 001
    2. 002
    3. 003
    4. 004
    5. 005
    6. 006
    7. 007
    8. 008
    9. 009
    10. 010
    11. 011
    12. 012
    13. 013
    14. 014
    15. 015
    16. 016
    17. 017
    18. 018
    19. 019
    20. 020
    21. 021
    22. 022
    23. 023
    24. 024
    25. 025
    26. 026
    27. 027
    28. 028
    29. 029
    30. 030
    31. 031
    32. 032
    33. 033
    34. 034
    35. 035
    36. 036
    37. 037
    38. 038
    39. 039
    40. 040
    41. 041
    42. 042
    43. 043
    44. 044
    45. 045
    46. 046
    47. 047
    48. 048
    49. 049
    50. 050
    51. 051
    52. 052
    53. 053
    54. 054
    55. 055
    56. 056
    57. 057
    58. 058
    59. 059
    60. 060
    61. 061
    62. 062
    63. 063
    64. 064
    65. 065
    66. 066
    67. 067
    68. 068
    69. 069
    70. 070
    71. 071
    72. 072
    73. 073
    74. 074
    75. 075
    76. 076
    77. 077
    78. 078
    79. 079
    80. 080
    81. 081
    82. 082
    83. 083
    84. 084
    85. 085
    86. 086
    87. 087
    88. 088
    89. 089
    90. 090
    91. 091
    92. 092
    93. 093
    94. 094
    95. 095
    96. 096
    97. 097
    98. 098
    99. 099
    100. 100
    type
      TForm1 = class(TForm)
        IBDB1: TIBDatabase;
        MainMenu1: TMainMenu;
        N1: TMenuItem;
        N2: TMenuItem;
        IBTransaction1: TIBTransaction;
        Pochtamt: TIBQuery;
        DSOPS: TDataSource;
        Detal: TIBQuery;
        DSDetal: TDataSource;
        IBQuery1: TIBQuery;
        ListBox1: TListBox;
        N3: TMenuItem;
        RabMesto: TIBQuery;
        DSRabMesto: TDataSource;
        IdIPWatch1: TIdIPWatch;
        DBGrid2: TDBGrid;
        Panel1: TPanel;
        Button2: TButton;
        Label2: TLabel;
        Edit1: TEdit;
        Label3: TLabel;
        Label4: TLabel;
        Edit3: TEdit;
        Label5: TLabel;
        Label6: TLabel;
        Edit4: TEdit;
        Button3: TButton;
        PMOPS: TPopupMenu;
        N6: TMenuItem;
        N7: TMenuItem;
        PMRabMesto: TPopupMenu;
        N9: TMenuItem;
        N10: TMenuItem;
        ListBox2: TListBox;
        Label14: TLabel;
        Label15: TLabel;
        Button6: TButton;
        PageControl1: TPageControl;
        TabSheet1: TTabSheet;
        TabSheet2: TTabSheet;
        Panel2: TPanel;
        Label11: TLabel;
        Label12: TLabel;
        Label13: TLabel;
        Button4: TButton;
        Memo1: TMemo;
        Button5: TButton;
        Edit6: TEdit;
        DBGrid1: TDBGrid;
        Label1: TLabel;
        DBMemo1: TDBMemo;
        Label16: TLabel;
    //    DBGrid2: TDBGrid;
        TabSheet3: TTabSheet;
        N11: TMenuItem;
        Label18: TLabel;
        Label9: TLabel;
        Edit7: TEdit;
        Label10: TLabel;
        MaskEdit1: TMaskEdit;
        MaskEdit2: TMaskEdit;
        TabSheet5: TTabSheet;
        N12: TMenuItem;
        LSostav: TIBQuery;
        DSLSostav: TDataSource;
        DBGrid4: TDBGrid;
        ListBox3: TListBox;
        PMLSostav: TPopupMenu;
        N13: TMenuItem;
        N14: TMenuItem;
        N15: TMenuItem;
        Panel3: TPanel;
        Label22: TLabel;
        Edit2: TEdit;
        Label23: TLabel;
        Edit8: TEdit;
        Label24: TLabel;
        MaskEdit3: TMaskEdit;
        MaskEdit4: TMaskEdit;
        MaskEdit5: TMaskEdit;
        Label25: TLabel;
        Label26: TLabel;
        MaskEdit6: TMaskEdit;
        Label27: TLabel;
        Button7: TButton;
        Button8: TButton;
        Label28: TLabel;
        Edit9: TEdit;
        Label29: TLabel;
        Edit10: TEdit;
        UpDown1: TUpDown;
        Label30: TLabel;
        Edit11: TEdit;
        Edit12: TEdit;
        Label31: TLabel;
        Label32: TLabel;
        Button9: TButton;
        N16: TMenuItem;

    Там еще 400 строк объявления компонентов формы и процедур и функций с аналогичными названиями...

    BotGovnokot, 08 Июня 2015

    Комментарии (9)
  9. Pascal / Говнокод #18137

    +141

    1. 1
    2. 2
    3. 3
    4. 4
    function GetArgs(const str:string):string;
    begin
      result:=strpas(pathgetargs(pchar(str))); //UB
    end;

    result:=strpas(pathgetargs(pchar(str))); //UB
    Плохой мальчик.

    Stertor, 09 Мая 2015

    Комментарии (0)
  10. Pascal / Говнокод #18113

    +143

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    function CopyEx(s:string; index,count:integer):string;
    var
      len,ln:integer;
    begin
      ln:=0;
      if index <1 then index:=1;
      len:=length(s);
      ln:=len-count;
      dec(ln);
      dec(len,(index+ln));
      result:=copy(s,index,len);
    end;

    Stertor, 04 Мая 2015

    Комментарии (5)