1. Лучший говнокод

    В номинации:
    За время:
  2. Java / Говнокод #3998

    +115

    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
    static final class Single extends Node {
            Node dup(boolean not) {
                if (not)
                    return new NotSingle(ch);
                else
                    return new Single(ch);
            }
            boolean study(TreeInfo info) {
                info.minLength++;
                info.maxLength++;
                return next.study(info);
            }
    static final class NotSingle extends Node {
            Node dup(boolean not) {
                if (not)
                    return new Single(ch);
                else
                    return new NotSingle(ch);
            }
            boolean study(TreeInfo info) {
                info.minLength++;
                info.maxLength++;
                return next.study(info);
            }
        }
    static final class SingleA extends Node {
            Node dup(boolean not) {
                if (not)
                    return new NotSingleA(ch);
                else
                    return new SingleA(ch);
            }
            boolean study(TreeInfo info) {
                info.minLength++;
                info.maxLength++;
                return next.study(info);
            }
        }
    
        static final class NotSingleA extends Node {
            int ch;
            NotSingleA(int n) {
                ch = ASCII.toLower(n);
            }
            Node dup(boolean not) {
                if (not)
                    return new SingleA(ch);
                else
                    return new NotSingleA(ch);
            }
    
            boolean study(TreeInfo info) {
                info.minLength++;
                info.maxLength++;
                return next.study(info);
            }
        }
    
        static final class Ctype extends Node 
            Node dup(boolean not) {
                if (not) {
                    return new NotCtype(ctype);
                } else {
                    return new Ctype(ctype);
                }
            }
            boolean study(TreeInfo info) {
                info.minLength++;
                info.maxLength++;
                return next.study(info);
            }
        }
    
    далее идут 
    static final class SingleU extends Node {
    static final class NotCtype extends Node {
    static final class NotSingleU extends Node {
    c очевидно какими методами внутри

    суровое ООП, главное что это не школьная поделка, а серъезнейший продукт
    продолжение #3976 #3975 #3940

    3.14159265, 16 Августа 2010

    Комментарии (39)
  3. C++ / Говнокод #3639

    +160

    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
    int S; 
    int A; 
    int random_integer = (rand()%3); 
    cout<<"Skolko vsego palochek\n"; 
    cin>>S; 
    cout<<"Komp zaberaet\n"; 
    S-=random_integer; 
    cout<<s<<"\n";>>A; 
    S-=A; 
    if (S==8) S-=3; cout<<"Komp Zaberaet\n"; 
    if (S==7) S-=2; cout<<"Komp Zaberaet\n"; 
    if (S==6) S-=1; cout<<"Komp Zaberaet\n"; 
    if (S==4) S-=3; cout<<"Komp Zaberaet\n"; 
    if (S==3) S-=2; cout<<"Komp Zaberaet\n"; 
    if (S==2) S-=1; cout<<"Komp Zaberaet\n"; 
    else 
    if (A==1) S-=3; cout<<"Komp Zaberaet\n"; 
    if (A==2) S-=2; cout<<"Komp Zaberaet\n"; 
    if (A==3) S-=1; cout<<"Komp Zaberaet\n"; 
    cout<<s<<"\n";>>A; 
    if (S<=0) cout<<"Vu proigrali\n"; 
    if (A!=3 && A!=2 && A!=1) cout<<"Mogno tolko ot 1-3 palochek\n";

    Вот такой суровый говнокод я встретил в одном из вопросов ВиО. То что код не рабочий и так понятно.

    Ivan0x32, 04 Июля 2010

    Комментарии (39)
  4. C++ / Говнокод #3552

    +170

    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
    //Файл teamWorkFile.h:
    static int teamWork(int e)
    {
    #if N==0
    	return 0;
    #elif N==1
    	return Work52(e+1);
    #elif
    	return WorkN(N);
    #endif
    };
    
    //Файл teamWork.h:
    //...
    #define MaxProc 6
    typedef int (*ProcTypeTeamWork)(int e);
    ProcTypeTeamWork Proc[MaxProc]; 
    #define N 0
    #define teamWork ProcName0
    #include "teamWorkFile.h"
    #undef teamWork
    #undef N
    #define N 1
    #define teamWork ProcName1
    #include "teamWorkFile.h"
    #undef teamWork
    #undef N
    int InitMultiProc()
    {
    	Proc[0]=ProcName0;
    	Proc[1]=ProcName1;
    	Proc[2]=ProcName1;
    	Proc[4]=ProcName0;
    	Proc[5]=ProcName1;
    	return 0;
    };
    
    //Файл teamWorkLib.cpp:
    #include "teamWork.h"
    //...
    InitMultiProc();
    ProcTypeTeamWork SuperProc=Proc[5];
    //Дальше в этом файле вызовы в стиле Proc[i](e);, SuperProc(255); и тд...

    Удивительный код состоит из 3х файлов(teamWorkLib.cpp, teamWork.h, teamWorkFile.h), но он того стоит.

    Говногость, 23 Июня 2010

    Комментарии (39)
  5. Java / Говнокод #3528

    +113

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    //java.io.Bits
        static void putDouble(byte[] b, int off, double val) {
    	long j = Double.doubleToLongBits(val);
    	b[off + 7] = (byte) (j >>> 0);
    	b[off + 6] = (byte) (j >>> 8);
    	b[off + 5] = (byte) (j >>> 16);
    	b[off + 4] = (byte) (j >>> 24);
    	b[off + 3] = (byte) (j >>> 32);
    	b[off + 2] = (byte) (j >>> 40);
    	b[off + 1] = (byte) (j >>> 48);
    	b[off + 0] = (byte) (j >>> 56);
        }

    остальное содержимое класса в таком же стиле

    3.14159265, 21 Июня 2010

    Комментарии (39)
  6. C++ / Говнокод #3388

    +1001

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    struct Dir {
        Dir(const char* name) {
            d = opendir("/var/log");
        }
        ~Dir();
        const char* next();
        bool operator== (DIR* other);
    private:
        DIR* d;
    };
    ...
    Dir var_log("/var/log");

    evlad, 03 Июня 2010

    Комментарии (39)
  7. PHP / Говнокод #2894

    +185.4

    1. 1
    2. 2
    3. 3
    4. 4
    function epic_die(){
        mysql_close();
        die();
    }

    Автор не я)

    a13ks3y, 29 Марта 2010

    Комментарии (39)
  8. PHP / Говнокод #2769

    +164.6

    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
    <HTML>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
    </meta>
    <BODY>
    <style>
    <? include "style.css"; ?>
    </style>
    <?
    include "menu.php";
    include "main.php";
    ?>
    </BODY>
    </HTML>

    Своеобразный способ подключения стилей)))
    Из ЛС вконтакта.

    Subsanek, 12 Марта 2010

    Комментарии (39)
  9. PHP / Говнокод #792

    +349.7

    1. 1
    define("_WINDOWS_",file_exists("c:\autoexec.bat") ? TRUE : FALSE);

    :)

    guest, 31 Марта 2009

    Комментарии (39)
  10. C++ / Говнокод #325

    +15.2

    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
    BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)
    {
        int dayofweek, month, year;
        UINT8 *month_tab;
    
        //Calculate current day of the week
        dayofweek = GetDayOfWeek(days);
    
        year = ORIGINYEAR;
    
        while (days > 365)
        {
            if (IsLeapYear(year))
            {
                if (days > 366)
                {
                    days -= 366;
                    year += 1;
                }
            }
            else
            {
                days -= 365;
                year += 1;
            }
        }
    
    
        // Determine whether it is a leap year
        month_tab = (UINT8 *)((IsLeapYear(year))? monthtable_leap : monthtable);
    
        for (month=0; month<12; month++)
        {
            if (days <= month_tab[month])
                break;
            days -= month_tab[month];
        }
    
        month += 1;
    
        lpTime->wDay = days;
        lpTime->wDayOfWeek = dayofweek;
        lpTime->wMonth = month;
        lpTime->wYear = year;
    
        return TRUE;
    }

    То что вызвало зависание всех MS Zune 30Gb по всему миру.

    guest, 03 Января 2009

    Комментарии (39)
  11. Куча / Говнокод #28820

    +1

    1. 1
    DDoS

    admin, 15 Июля 2023

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