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

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

    −452.5

    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
    z=1;
    b1.onRelease = function() {
        if(xo1._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo1._alpha=100;
        xo1.gotoAndStop(z);}
    };
    
    b2.onRelease = function() {
        if(xo2._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo2._alpha=100;
        xo2.gotoAndStop(z);}
    };
    
    b3.onRelease = function() {
        if(xo3._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo3._alpha=100;
        xo3.gotoAndStop(z);}
    };
    
    b4.onRelease = function() {
        if(xo4._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo4._alpha=100;
        xo4.gotoAndStop(z);}
    };
    
    b5.onRelease = function() {
        if(xo5._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo5._alpha=100;
        xo5.gotoAndStop(z);}
    };
    
    b6.onRelease = function() {
        if(xo6._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo6._alpha=100;
        xo6.gotoAndStop(z);}
    };
    
    b7.onRelease = function() {
        if(xo7._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo7._alpha=100;
        xo7.gotoAndStop(z);}
    };
    
    b8.onRelease = function() {
        if(xo8._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo8._alpha=100;
        xo8.gotoAndStop(z);}
    };
    
    b9.onRelease = function() {
        if(xo9._alpha!=100){
        z+=1;
        if(z>2){z=1}
            xo9._alpha=100;
        xo9.gotoAndStop(z);}
    };

    Интерфейс крестиков-ноликов на флеше, AS.

    guest, 12 Декабря 2008

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

    −593.8

    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
    Dim cr
    
    Private Function click()
    If cr = 0 Then
    cr = 1
    click = "X"
    Else
    cr = 0
    click = "O"
    End If
    End Function
    Private Sub CommandButton1_Click()
    If CommandButton1.Caption = "" Then CommandButton1.Caption = click()
    End Sub
    
    Private Sub CommandButton10_Click()
    cr = 0
     CommandButton1.Caption = ""
     CommandButton2.Caption = ""
     CommandButton3.Caption = ""
     CommandButton4.Caption = ""
     CommandButton5.Caption = ""
     CommandButton6.Caption = ""
     CommandButton7.Caption = ""
     CommandButton8.Caption = ""
     CommandButton9.Caption = ""
     
    End Sub
    
    Private Sub CommandButton2_Click()
    If CommandButton2.Caption = "" Then CommandButton2.Caption = click()
    
    End Sub
    
    Private Sub CommandButton3_Click()
    If CommandButton3.Caption = "" Then CommandButton3.Caption = click()
    End Sub
    
    Private Sub CommandButton4_Click()
    If CommandButton4.Caption = "" Then CommandButton4.Caption = click()
    End Sub
    
    Private Sub CommandButton5_Click()
    If CommandButton5.Caption = "" Then CommandButton5.Caption = click()
    End Sub
    
    Private Sub CommandButton6_Click()
    If CommandButton6.Caption = "" Then CommandButton6.Caption = click()
    End Sub
    
    Private Sub CommandButton7_Click()
    If CommandButton7.Caption = "" Then CommandButton7.Caption = click()
    End Sub
    
    Private Sub CommandButton8_Click()
    If CommandButton8.Caption = "" Then CommandButton8.Caption = click()
    End Sub
    
    Private Sub CommandButton9_Click()
    If CommandButton9.Caption = "" Then CommandButton9.Caption = click()
    End Sub

    Крестики-нолики на Power Point за 2 минуты.

    guest, 12 Декабря 2008

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

    −32

    1. 1
    #define NULL 1

    :) Из той же оперы, что и http://govnokod.ru/62

    guest, 12 Декабря 2008

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

    −53.9

    1. 1
    2. 2
    3. 3
    $g_db->q("SELECT * FROM {$GLOBAL['db']['pref']}_volumes 
              WHERE `visible` != 0 AND `owner_id`={$duser['u_id']} 
              AND (`parent_volume`=0 OR `parent_volume`!=0)"); //<-- Чёрная магия! Не редактировать!

    Без ТАКОГО последнего AND возвращает 0 строк :(

    guest, 11 Декабря 2008

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

    +25.9

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    if(dOper1p->Caption == "-0")
       dOper1p->Caption = "+0";
     if(dOper2p->Caption == "-0")
       dOper2p->Caption = "+0";
    
     if(dOper1m->Caption == "-0.0")
       dOper1m->Caption = "+0.0";
     if(dOper2m->Caption == "-0.0")
       dOper2m->Caption = "+0.0";

    типичный представитель говнокода

    guest, 10 Декабря 2008

    Комментарии (9)
  7. C# / Говнокод #90

    −10.5

    1. 1
    this.SelectedDate = this.SelectedDate;

    Проверяем дату на корректность...

    guest, 10 Декабря 2008

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

    +52.3

    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
    //разметка матрицы
    
     while ((founded==1)&&(mat[nx][ny]<=0)) {
      founded=0;
      iii=y-i;
      while (((i==0)&&(iii==y))||((iii<=y+i))){
       ii=x-i;
       while ((ii<=x+i)){
    	if ((mat[ii][iii]==i)&&((ii<70)&&(ii>=0))&&((iii<70)&&(iii>=0))) {
    	 bii=ii;
    	 biii=iii;
    	 if ((mat[bii+1][biii]==-1)&&(bii+1<70)&&(bii+1>=0)) {
    	  mat[bii+1][biii]=i+1;
    	  founded=1;
    	 }
    	 if ((mat[bii-1][biii]==-1)&&(bii-1<70)&&(bii-1>=0)) {
    	  mat[bii-1][biii]=i+1;
    	  founded=1;
    	 }
    	 if ((mat[bii][biii+1]==-1)&&(biii+1<70)&&(biii+1>=0)) {
    	  mat[bii][biii+1]=i+1;
    	  founded=1;
    	 }
    	 if ((mat[bii][biii-1]==-1)&&(biii-1<70)&&(biii-1>=0)) {
    	  mat[bii][biii-1]=i+1;
    	  founded=1;
    	 }
    	}
    	ii++;
       }
       iii++;
      }
      i++;
     }
     if (mat[nx][ny]>=0) {
      if ((nx==40)&&(ny==57)) {
       nx=nx;
      }
      ik=i;
    
      ii=nx;
      iii=ny;
      //поиск пути
    
      while (ik>1) {
       if ((mat[ii-1][iii]==ik-1)&&(ii-1<70)&&(ii-1>=0)) {
    	ii--;
    	mat[ii][iii]=-3;
       }
       if ((mat[ii][iii-1]==ik-1)&&(iii-1<70)&&(iii-1>=0)) {
    	iii--;
    	mat[ii][iii]=-3;
       }
       if ((mat[ii+1][iii]==ik-1)&&(ii+1<70)&&(ii+1>=0)) {
    	ii++;
    	mat[ii][iii]=-3;
       }
    
       if ((mat[ii][iii+1]==ik-1)&&(iii+1<70)&&(iii+1>=0)) {
    	iii++;
    	mat[ii][iii]=-3;
       }
       ik--;
      }
       ax=ii*10+5;
       ay=iii*10+5;
      //out_to_file(mat,"d:\\out.txt");
      i++;
       ii=0;
       iii=0;
       while ((iii>-1)&&(iii<70)){
    	ii=0;
    	while ((ii>-1)&&(ii<70)){
    	 if ((mat[ii][iii]>-1)||(mat[ii][iii]==-3)) {
    	  mat[ii][iii]=-1;
    	 }
    	 ii++;
    	}
    	iii++;
       }
      nx=ax;
      ny=ay;
     } else ...
     }

    Разметка матрицы, Поиск Пути.

    guest, 08 Декабря 2008

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

    +24

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    /**
      * Getter for billbackAdjustmentType 
      *
      * @return the billbackAdjustmentType instance
      */
    public BillbackAdjustmentType getBillbackAdjustmentType() {
        return billbackAdjustmentType != null ? billbackAdjustmentType : BillbackAdjustmentType.PlusBillbackAdjustment;
    }

    ...и попробуй такое найди под дебагом :)

    guest, 04 Декабря 2008

    Комментарии (9)
  10. Куча / Говнокод #29264

    0

    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
    Lemma mfun_equiv_commut f g g1 g2 :
      mfun_equiv g (g2 ∘ g1) ->
      commute f g1 ->
      commute f g2 ->
      commute f g.
    Proof.
      intros Hg Hcomm_g1 Hcomm_g2 a z.
      split; intros H; unfold mfun_equiv in Hg.
      - destruct H as [b [Hb Hz]].
        rewrite Hg in Hz.
        destruct Hz as [d [Hd Hz]].
        destruct (Hcomm_g1 a d) as [Hg1f Hfg1]. clear Hfg1.
        destruct Hg1f as [d' [Had' Hcd']]. { sauto. }
        morph_shift g2 d'.
        destruct Had' as [c' Hc'].
        destruct (Hcomm_g2 c' z') as [Hg2f Hfg2].
        destruct Hg2f as [z'' [Hz'' Hz'z'']]. { sauto. }
        destruct Hz'' as [e'' He''].
        exists z''.
        split.
        + exists e''.
          split.
          * rewrite Hg. sauto.
          * easy.
        + now rewrite Hequiv_z_z', Hz'z''.
      - destruct H as [c [Hc Hz]].
        rewrite Hg in Hc.
        destruct Hc as [b [Hb Hc]].
        destruct (Hcomm_g2 b z) as [Hg2f Hfg2]. clear Hg2f.
        destruct Hfg2 as [z' [Hbz' Hzz']]. { sauto. }
        destruct Hbz' as [d [Hdz' Hbd']].
        destruct (Hcomm_g1 a d) as [Hg1f Hfg1]. clear Hg1f.
        destruct Hfg1 as [d' [Had' Hdd']]. { sauto. }
        destruct Had' as [b' [Hab' Hb'd']].
        morph_shift g2 d'.
        exists z''.
        split.
        + exists b'.
          split.
          * easy.
          * rewrite Hg. exists d'. sauto.
        + now rewrite Hzz', Hequiv_z'_z''.
    Qed.

    Why are we here, just to suffer?

    CHayT, 30 Мая 2026

    Комментарии (8)
  11. C++ / Говнокод #29207

    0

    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
    #include <iostream>
    #include <type_traits>
    #include <mutex>
    #include <string>
    #include <memory>
    #include <vector>
    #include <chrono>
    
    void bad_function(void* data) {
       ///  НИКОГДА ТАК НЕ ПИШИ
        if (data) {
            std::cout << *(std::string*)data << "\n";
        }
    }
    
    template<typename T = std::string,
             typename Alloc = std::allocator<T>,
             typename = std::enable_if_t<std::is_constructible_v<T, const char*>>,
             typename Clock = std::chrono::high_resolution_clock,
             typename TimePoint = typename Clock::time_point>
    class GoodFunctionImpl {
    private:
        static std::recursive_mutex mtx_;
        Alloc alloc_;
        std::vector<T, Alloc> buffer_;
        std::string context_;
        TimePoint init_time_;
        
        template<typename U>
        using is_valid_type = std::conjunction<
            std::is_same<std::decay_t<U>, T>,
            std::is_constructible<T, U>
        >;
        
        void internal_log(const std::string& msg) {
            buffer_.push_back(T(msg.c_str()));
        }
        
    public:
        GoodFunctionImpl() : init_time_(Clock::now()) {
            internal_log("GoodFunctionImpl initialized");
        }
        
        template<typename U,
                 typename = std::enable_if_t<is_valid_type<U>::value>>
        decltype(auto) execute(U&& input) {
            std::lock_guard<std::recursive_mutex> lock(mtx_);
            
            internal_log("Processing started");
            
            T processed = std::forward<U>(input);
            
            auto duration = Clock::now() - init_time_;
            auto duration_ms = std::chrono::duration_cast<
                std::chrono::milliseconds>(duration).count();
            
            std::cout << processed << " (runtime: " 
                      << duration_ms << "ms)\n";
            
            internal_log("Processing completed");
            
            return processed;
        }
        
        size_t get_buffer_size() const { return buffer_.size(); }
    };
    
    template<typename T, typename Alloc, typename, typename Clock, typename TimePoint>
    std::recursive_mutex GoodFunctionImpl<T, Alloc, Clock, TimePoint>::mtx_;
    
    void good_function(const std::string& input) {
        // Пиши ВОТ ТАК
        // так делают все
        // это стабильно и надежно
        // так надо
        GoodFunctionImpl<> impl;
        auto result = impl.execute(input);
        
        std::cout << "Buffer entries: " 
                  << impl.get_buffer_size() << "\n";
    }

    lisp-worst-code, 06 Декабря 2025

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