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

    В номинации:
    За время:
  2. Куча / Говнокод #13747

    +121

    1. 1
    #include "commode.h"

    //development might be long and harassing
    //we'll need some furniture to keep food and coffee

    ckopo, 06 Сентября 2013

    Комментарии (1)
  3. Куча / Говнокод #13702

    +141

    1. 1
    2. 2
    Хаскелисты против Сионистов:
    http://trollingnews.com/

    USB, 29 Августа 2013

    Комментарии (1)
  4. JavaScript / Говнокод #13654

    +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
    <body style=margin:0 
    
    onload="for( 
    
    s=window.screen, 
    w=q.width=s.width, 
    h=q.height=s.height, 
    m=Math.random, 
    p=[], 
    i=0; i<256; 
    
    p[i++]=1 );
    
    setInterval('9Style=\'rgba(0,0,0,.05)\'9Rect(0,0,w,h)9Style=\'#0F0\';
    
    p.map(function(v,i){9Text(String.fromCharCode(3e4+m()*33),i*10,v);
    p[i]=v>758+m()*1e4?0:v+10})'.split(9).join(';q.getContext(\'2d\').fill'),33)">
    
    
    <canvas id=q>

    Найди утечку ( many many times i jerk -> ctx ;)

    Stealth, 23 Августа 2013

    Комментарии (1)
  5. C# / Говнокод #13633

    +137

    1. 1
    2. 2
    3. 3
    IServerRequest request = new ServerRequest(GetServerURL(serverType));
    
    if (request != null)

    На всякий случай.

    Belorus, 21 Августа 2013

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

    +140

    1. 1
    while(index --> 1)

    iNsectus, 17 Августа 2013

    Комментарии (1)
  7. JavaScript / Говнокод #13613

    +137

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    function showTimeToLive(doTranslation)
    {
        doTranslation = (doTranslation == undefined) ? true : doTranslation;
        ....
        timer = window.setTimeout (doTranslation ? "turnOff(true)" : "turnOff(false)", secs)
        ....
    }

    falsting, 15 Августа 2013

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

    +146

    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
    if ( $d[1][0] = 'XXXXXXXXXXXXX' && $d[1][1][1] != 'false' ) {         
        $render .= 'XXXXXXXXXXXXX';
          if ( isset($d[1][2][1][0]) || isset($d[1][1][1][0]) ) {
    
            if ( !is_numeric($d[1][2][0]) ) { 
              $wrap = $d[1][1][1];  
            } else { 
              $wrap = $d[1][2][1]; unset($d[1][2][1]);
            }
                $render .= '<ul>';
                foreach ( $wrap as $map ) {
                  $render .= '<li>XXXXX: ' . $map . '</li>';
                  $checkSm = preg_replace('/\s+$/m', '', $map);          
                } $render .= '</ul>';
            
          } else {  $render .= '<p><del>XXXXXXXXXXXXXXX</del></p>';  }  
                   //%print $render;
              
          if ( $d[1][1][0] == 'true' ) {      
           
              $render .= '<p><small>XXXXXXXX</small> XXXXXXXXXXXXXXXXXX <i>' . $d[1][1][1] . '</i></p>';
              $checkSh = preg_replace('/\s+$/m', '', $d[1][1][1]);
                  
          } else if ( isset($d[1][1][1][0]) && $d[1][1][0] != 'true' || !isset($d[1][1]) ) {  
              $render .= '<p><del>XXXXXXXXXXXXXXXXX</del></p>';  }                
                                      
        
          } unset($d[1]);
                   
          $d = ''; return $render;

    Frau Фарш &copy; Еблыськин груп Оптимизэйшн

    Stealth, 09 Августа 2013

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

    +153

    1. 1
    2. 2
    3. 3
    function getAllStatuses() { # SHIT!
        throw new Exception('OrdersAdmin::GetAllStatuses is shit');
    }

    нашел в старом движке, видимо так и не вызывалось

    shitcoder, 08 Августа 2013

    Комментарии (1)
  10. Java / Говнокод #13517

    +58

    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
    private void getPCTurn(char s){
            int done = 0;
            System.out.println("Now the turn of " + s +" \n Computer thinking...");
            analysis:
                while(done == 0){
                    int numbX;
                    for(int i = 0; i < field.length; i++){
                         numbX = 0; // check horisontals for 00
                        for (int j = 0; j < field.length; j++){
                            if (field[i][j] == s){
                                numbX++;
                            }
                            if (numbX == (field.length-1)){
                                for (j = 0; j < field.length; j++){
                                    if (field[i][j] == DEF_FIELD){
                                        field[i][j] = s;
                                        done++;
                                        break analysis;
                                    }
                                }
                            }
                        }
                        numbX = 0; // check verticals for 00
                        for (int j = 0; j < field.length; j++){
                            if (field[j][i] == s){
                                numbX++;
                            }
                            if (numbX == (field.length-1)){
                                for (j = 0; j < field.length; j++){
                                    if (field[j][i] == DEF_FIELD){
                                        field[j][i] = s;
                                        done++;
                                        break analysis;
                                    }
                                }
                            }
                        }
                    }
                     numbX = 0; //check diagonal for 00
                        for (int i = 0;i < field.length; i++){
                            if (field[i][i] == s){
                                numbX++;
                            }
                            if (numbX == (field.length-1)){
                                for (i = 0;i < field.length; i++){
                                    if (field[i][i] == DEF_FIELD){
                                        field[i][i] = s;
                                        done++;
                                        break analysis;
                                    }
                                }
                            }
                        }
                        numbX = 0; // check second diagonal for 00
                        for (int i = (field.length - 1);i >= 0; i--){
                            int j = (field.length - 1)-i;
                            if (field[i][j] == s){
                                numbX++;
                            }
                            if (numbX == (field.length-1)){
                                for (i = (field.length - 1);i >= 0; i--){
                                    j = (field.length - 1)-i;
                                    if (field[i][j] == DEF_FIELD){
                                        field[i][j] = s;
                                        done++;
                                        break analysis;
                                    }
                                }
                            }
                        }
                    for(int i = 0; i < field.length; i++){
                        numbX = 0; // check horisontals for XX
                        for (int j = 0; j < field.length; j++){
                            if (field[i][j] != s && field[i][j] != DEF_FIELD){
                                numbX++;
                            }
                            if (numbX == (field.length-1)){
                                for (j = 0; j < field.length; j++){
                                    if (field[i][j] == DEF_FIELD){
                                        field[i][j] = s;
                                        done++;
                                        break analysis;
                                    }
                                }
                            }
                        }
    
    // to be continued ...

    "Незамысловатая" реализация искусственного интеллекта для игры "Крестики-Нолики" от sv1979.
    Оригинал -> https://github.com/sv1979/svhome1/blob/master/src/TicTacToe/Field.java

    W1nneR, 31 Июля 2013

    Комментарии (1)
  11. Си / Говнокод #13508

    +123

    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
    strncpy (szString, GetPropChar(ParentPicture,"Faceplate instance1","IN0_text_ON") , sizeof(szString));
    if (strlen(szString)!=0)	
        { SetPropBOOL(lpszPictureName, "Input Bit 0" , "Visible", 1);
         SetPropBOOL(lpszPictureName, "I_b0" , "Visible", 1);
       }
    else
        { SetPropBOOL(lpszPictureName, "Input Bit 0" , "Visible", 0); 
          SetPropBOOL(lpszPictureName, "I_b0" , "Visible", 0);
        }
    
    strncpy (szString, GetPropChar(ParentPicture,"Faceplate instance1","IN1_text_ON") , sizeof(szString));
    if (strlen(szString)!=0)	
        { SetPropBOOL(lpszPictureName, "Input Bit 1" , "Visible", 1);
         SetPropBOOL(lpszPictureName, "I_b1" , "Visible", 1);
       }
    else
        { SetPropBOOL(lpszPictureName, "Input Bit 1" , "Visible", 0); 
          SetPropBOOL(lpszPictureName, "I_b1" , "Visible", 0);
        }

    Скрипт для WinCC. И так 8 раз подряд.
    Написал начальник отдела разработчиков (Си— не его специализация), как часть большого концептуального объекта, с которым мне и надо работать. А я не могу с этим работать, ощущая вот такие говенные внутренности.

    MereNonsense, 29 Июля 2013

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