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

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

    +30

    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
    private static string identifier(string wmiClass, string wmiProperty)
                {
                    string result = "";
                    System.Management.ManagementClass mc =
                new System.Management.ManagementClass(wmiClass);
                    System.Management.ManagementObjectCollection moc = mc.GetInstances();
                    foreach (System.Management.ManagementObject mo in moc)
                    {
                        //Only get the first one
                        if (result == "")
                        {
                            try
                            {
                                result = mo[wmiProperty].ToString();
                                break;
                            }
                            catch
                            {
                            }
                        }
                    }
                    return result;
                }

    guest, 08 Декабря 2008

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

    0

    1. 1
    Бесконечный оффтоп имени Гологуба #8

    #1: https://govnokod.ru/28992 https://govnokod.xyz/_28992
    #2: https://govnokod.ru/29053 https://govnokod.xyz/_29053
    #3: https://govnokod.ru/29075 https://govnokod.xyz/_29075
    #4: https://govnokod.ru/29110 https://govnokod.xyz/_29110
    #5: https://govnokod.ru/29127 https://govnokod.xyz/_29127
    #6: https://govnokod.ru/29140 https://govnokod.xyz/_29140
    #7: https://govnokod.ru/29170 https://govnokod.xyz/_29170

    nepeKamHblu_nemyx, 26 Октября 2025

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

    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
    let fallbackFunc = ()=>console.log("Hello, World!");
    let settings = {
        fallbackButtonName: "Hello, World!",
        fallbackWidth: 512,
        fallbackHeight: 512,
        settingsMenuExitButtonHeight: 32,
        settingsMenuExitButtonName: "X",
        settingElementHeight: 32,
        settingsMenuExitButtonAtBeginning: true,
        settingElementTrueName: "ON",
        settingElementFalseName: "OFF",
        settingsMenuBooleanSeperatorName: "- $",
        hideExtraButtonsToolbar: true,
        updateToolbar: updateToolbar,
        updateSettingsMenu: updateSettingsMenu,
        activateFallbackFunc: fallbackFunc
    };
    
    let settingsMenu = document.getElementById("settings");
    let settingsElement = document.querySelector(".setting-element#hide");
    
    // -------------------------------------------------------------------
    
    function updateSettingsMenu() {
        settingsMenu.innerHTML = "";
        let exitButton = document.createElement("button");
        exitButton.style.height = settings.settingsMenuExitButtonHeight+"px";
        exitButton.innerText = settings.settingsMenuExitButtonName;
        exitButton.onclick = function() {
            settingsMenu.style.display = "none";
        }
    
        if (settings.settingsMenuExitButtonAtBeginning) settingsMenu.appendChild(exitButton);
        for (let k in settings) {
            let v = settings[k];
    
            let setting = settingsElement.cloneNode(true);
            setting.id = "";
            console.log(setting)
            setting.style.height = settings.settingElementHeight+"px";
            let [name,value] = setting.children;
            if (typeof v !== "function") {
                name.innerText = k;
                function booleanToString(bool) {
                    return (bool?settings.settingsMenuBooleanSeperatorName.replaceAll("$",settings.settingElementTrueName):settings.settingsMenuBooleanSeperatorName.replaceAll("$",settings.settingElementFalseName))
                }
                value.innerText = (typeof v === "boolean")?booleanToString(v):v;
                value.onclick = function() {
                    if (typeof v === "boolean") {
                        settings[k] = !settings[k];
                        value.innerText = booleanToString(settings[k]);
                    } else {
                        let input = prompt(`New value for ${k}:`);
                        let newValue = isNaN(input)?input:Number(input);
                        value.innerText = newValue;
                        settings[k] = newValue
                    }
                }
            } else {
                name.remove()
                value.innerText = k;
                value.onclick = v;
            }
    
            settingsMenu.appendChild(setting);
        }
        if (!settings.settingsMenuExitButtonAtBeginning) settingsMenu.appendChild(exitButton);
    }
    function showSettings() {
        settingsMenu.style.display = "flex";
        updateSettingsMenu();
    }

    Как вам код?

    manabanana, 29 Сентября 2025

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

    +1

    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
    using Godot;
    
    namespace CW2EB.UI;
    public partial class EscQuittingLabel : Label {
    
    	Tween tween, tween2thesequel;
    	public override void _Ready(){
    		base._Ready();
    		tween = GetTree().CreateTween().SetParallel();
    		tween2thesequel = GetTree().CreateTween();
    		tween.TweenProperty(this, "theme_override_colors/font_color", new Color(1f, 1f, 1f, 1f), 1);
    		tween.TweenProperty(this, "theme_override_colors/font_shadow_color", new Color(0f, 0f, 0f, 1f), 1);
    
    		
    		tween2thesequel.TweenCallback(Callable.From(TweenStage1)).SetDelay(.25);
    		tween2thesequel.TweenCallback(Callable.From(TweenStage2)).SetDelay(.25);
    		tween2thesequel.TweenCallback(Callable.From(TweenStage3)).SetDelay(.25);
    		tween2thesequel.TweenCallback(Callable.From(TweenStage4)).SetDelay(.5);
    	}
    
    	public void TweenStage1()
    		=> Text = Tr("Quitting") + ".";
    
    	public void TweenStage2()
    		=> Text = Tr("Quitting") + "..";
    
    	public void TweenStage3()
    		=> Text = Tr("Quitting") + "...";
    
    	public void TweenStage4()
    		=> GetTree().Quit();
    }

    Как сделать постепенно появляющееся многоточие?

    GhostNoise, 29 Сентября 2025

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

    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
    n = int(input())
    d = n
    i = 0
    a = 0
    c = 0
    has1 = False
    has2 = False
    has3 = False 
    has4 = False
    has5 = False
    has6 = False
    has7 = False
    has8 = False
    last_dig = 0
    while n > 0:
        last_dig = n % 10
        if last_dig > i :
            i = last_dig
            if last_dig == 1:
                c = 1
        elif last_dig == 1:
            has1 = True
        elif last_dig == 2:
            has2 = True
        elif last_dig == 3:
            has3 = True
        elif last_dig == 4:
            has4 = True
        elif last_dig == 5:
            has5 = True
        elif last_dig == 6:
            has6 = True
        elif last_dig == 7:
            has7 = True
        elif last_dig == 8:
            has8 = True
        n = n // 10
    c = d % 10
    if has1 == True and c >= 1:
        a = 1
    elif has2 == True and c >= 2:
        a = 2
    elif has3 == True and c >= 3:
        a = 3
    elif has4 == True and c >= 4:
        a = 4
    elif has5 == True and c >= 5:
        a = 5
    elif has6 == True and c >= 6:
        a = 6
    elif has7 == True and c >= 7:
        a = 7
    elif has8 == True and c >= 8:
        a = 8
    else:
        a = c
    print('Максимальная цифра равна', i)
    print('Минимальная цифра равна', a)

    Дано натуральное число n. Напишите программу, которая определяет его максимальную и минимальную цифры

    Permanent_Record, 28 Июля 2025

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

    +1

    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
    (defun sbcl-vrt-simd-pntr (a f fa &aux (defun (progn (defmacro << (x y) `,(ash x y)) (defmacro >> (x y) `,(ash x (- y))) (defmacro ~ (x) `(lognot ,x))))
                                           (if (progn (labels ((t (a f fa) (declare (type integer a)
                                                                                    (type (function (integer (function () (values)) (pointer single-float)) integer) f)
                                                                                    (type (array real (*)) fa))
                                                                           (declaim (optimize (speed (the (list integer (*)) '(-1 0 1))) (debug 0) (safety 0) (space 0))))) (funcall #'t a f fa)))))
    
      (defclass res (standard-class) ((%size-st :initform nil :accessor size-st)))
      (defclass d (standard-class) ((%size-n :initform nil :accessor size-n)))
      (defmethod sb-mop:validate-superclass ((class class) (meta standard-class)) defun t)
      (defmethod initialize-instance :after ((obj res) &key &allow-other-keys) (setf (size-st obj) (sb-vm::primitive-object-size (type-of (let ((a #xFFFF)) (declare (type (integer #x0 #xFFFF) a)))))))
      (defmethod initialize-instance :after ((obj d) &key) (setf (size-n obj) (sb-vm::primitive-object-size 0)))
      (defclass simd-virtual-guard (res d) ((%spn :initform 0 :accessor spn :type integer)) (:metaclass d))
    
      (let ((lac (make-instance 'simd-virtual-guard)) (data f) (b "8153024679"))
        `(declare (type (array (member ,(let* ((i '())) (do* ((y 0 (+ y 1))) ((= (- y 1) 9) 'nil) (push y i)))) (3)) data)
                  (type string b)
                  (type simd-virtual-duard lac))
    
        (setf (spn lac) (+ (size-st lac) (size-n lac)))
    
        (loop for ll from (- (sb-vm::primitive-object-size b) 55) downto 0 by 4
              do (progn
                   (setf (char b ll) #\0)
                   (setf (char b (- ll #x1)) #\1)
                   (setf (char b (if (= ll 1) (- (+ ll 9) #x2) (- ll #x2))) #\2)))
    
        (- (ash 1 2) (- (char-code (char b 0)) (sb-vm::primitive-object-size "2")))))
    
    (defun sbcl-vrt-simd64 (f0 f1 &aux (returnable 0) (declare (labels ((nil (f0 f1) (declare (type (function ()) f0) (type (function ()) f1)))) (funcall #'nil f0 f1))))
      (labels ((pntr (addr) (sb-sys:sap-ref-8 (sb-sys:int-sap addr) 0))
               (ref (obj) (sb-kernel:get-lisp-obj-address obj)))
    
        (macrolet ((s (v) `(setq returnable ,v)))
          (let ((d (- (ref f0) (ref f1))))
            (declare (type integer d))
    
            (if (not (ash (- (* (integer-length 0) (integer-length 0)) 1) d))
              (do* ((d d (- d 1))) (zerop d)
                (case (+ (ref f0) d)
                  (0XC3C9 (s 0))
                  (0XB8 (if (not (+ (ref f0) d 1)) (s 1) (s -1))
                  (0XC031 (s 2)))))))
    
          (return-from sbcl-vrt-simd64 returnable))))

    пародия на https://www.govnokod.ru/29120

    lisp-worst-code, 23 Июня 2025

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    ...В детстве я любил русские народные сказки из сборника Афанасьева.
    Сюжет даже откровенно взрослых сказок он передавал мягко, избегая зауми; с грубоватым, народным юмором, слегка подпёздывая, а затем плавно 
    и в подробностях подходя к кульминации.
    
    После того, как я уже в зрелом возрасте прочел, как барыня заставила холопа нюхать свою пизду, я стал практиковать воздержание.

    Ну его нахуй, сказка ведь может и былью статься.
    Нужно срочно запретить сказки! Тем более, что все перечисленные в них извращения успешно практикуют и те дети, кому и сказок-то не читали.

    3uMuCTOH, 28 Мая 2025

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

    0

    1. 1
    Россия погрязла в мусоре и крысятах.

    Тех, кто учит убивать крыс, недалек. Мы прибираем за людьми, но этого не ценят.
    Всевышний сделал нас плодовитыми, чтобы не дай Бог, глупые люди не истребили нас - ибо голубой шарик сильно развоняется под миллионами тонн гниющей органики, которую некому будет перерабатывать.

    Не убивайте крыс и будьте довольны ими. Будьте им благодарны.
    На одно коленце опуститься тоже не помешает...

    KPblCA, 21 Мая 2025

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

    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
    before = []
    
    def bef():
        global before
        return before
    
    def setB(b):
        global before
        before = b
    
    def foo():
        revert(bef())

    NikitaTsyb, 15 Мая 2025

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    Ну вот, теперь и я попал в поле зрения спецслужб. 
    Хотя, возможно, я и раньше был в поле зрения спецслужб, а узнал об этом только сейчас.
    
    Почему эти уродцы не пресекают коррупцию? Какой смысл следить за мной?

    Это не паранойя.
    Паранойя разовьется позже. Hemingway.png

    3uMuCTOH, 06 Апреля 2025

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