1. Куча / Говнокод #29165

    0

    1. 1
    Пиздец-оффтоп #114

    #84: https://govnokod.ru/28795 https://govnokod.xyz/_28795
    #85: https://govnokod.ru/28808 https://govnokod.xyz/_28808
    #86: (vanished) https://govnokod.xyz/_28814
    #87: https://govnokod.ru/28817 https://govnokod.xyz/_28817
    #88: https://govnokod.ru/28836 https://govnokod.xyz/_28836
    #89: https://govnokod.ru/28843 https://govnokod.xyz/_28843
    #90: https://govnokod.ru/28874 https://govnokod.xyz/_28874
    #91: https://govnokod.ru/28880 https://govnokod.xyz/_28880
    #92: https://govnokod.ru/28884 https://govnokod.xyz/_28884
    #93: https://govnokod.ru/28889 https://govnokod.xyz/_28889
    #94: https://govnokod.ru/28895 https://govnokod.xyz/_28895
    #95: https://govnokod.ru/28904 https://govnokod.xyz/_28904
    #96: https://govnokod.ru/28912 https://govnokod.xyz/_28912
    #97: https://govnokod.ru/28918 https://govnokod.xyz/_28918
    #98: https://govnokod.ru/28932 https://govnokod.xyz/_28932
    #99: https://govnokod.ru/28936 https://govnokod.xyz/_28936
    #100: https://govnokod.ru/28940 https://govnokod.xyz/_28940
    #101: https://govnokod.ru/28949 https://govnokod.xyz/_28949
    #102: https://govnokod.ru/28978 https://govnokod.xyz/_28978
    #103: https://govnokod.ru/28982 https://govnokod.xyz/_28982
    #104: https://govnokod.ru/28989 https://govnokod.xyz/_28989
    #105: https://govnokod.ru/29052 https://govnokod.xyz/_29052
    #106: https://govnokod.ru/29069 https://govnokod.xyz/_29069
    #107: https://govnokod.ru/29086 https://govnokod.xyz/_29086
    #108: https://govnokod.ru/29102 https://govnokod.xyz/_29102
    #109: https://govnokod.ru/29126 https://govnokod.xyz/_29126
    #110: https://govnokod.ru/29136 https://govnokod.xyz/_29136
    #111: https://govnokod.ru/29142 https://govnokod.xyz/_29142
    #112: https://govnokod.ru/29155 https://govnokod.xyz/_29155
    #113: https://govnokod.ru/29160 https://govnokod.xyz/_29160

    nepeKamHblu_nemyx, 28 Июля 2025

    Комментарии (135)
  2. 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)
  3. Python / Говнокод #29163

    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
    n = int(input())
    a = n
    i = 0
    last_digit = 0
    total = 0
    while n != 0:
        i += 1
        n = n // 10
    while a != 0:
        last_digit = (a % 10) * 10 ** i 
        total += last_digit
        i = i - 1
        a = a // 10
    print(total // 10)

    Дано натуральное число. Напишите программу, которая меняет порядок цифр числа на обратный. В той Вселенной, откуда пришел этот код, end просто не существует...

    Permanent_Record, 28 Июля 2025

    Комментарии (0)
  4. Python / Говнокод #29162

    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
    n = input().strip('#')
    n = int(n)
    for _ in range(n):
        s = input()
        if '#' not in s:
            s = s.rstrip()
            print(s)
        else:
            i = 0
            count = 0
            while s[i].isspace():
                count += 1
                i += 1
            s = s.strip()
            l = s.split(' ')
            while True:
                item = l.pop(-1)
                if '#' in item:
                    break
            if count != 0:
                l.insert(0, ' '*(count - 1))
            count = 0
            m = ' '.join(l)
            print(m.rstrip())

    На вход программе подаётся натуральное число в формате #n, а затем n строк с кодом, в котором нужно удалить все комментарии и сохранить всё остальное как есть. Зачем вся эта хрень со списками, когда можно решить в несколько строк методами строк, простите за каламбур!

    Permanent_Record, 27 Июля 2025

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

    +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
    45. 45
    46. 46
    47. 47
    48. 48
    <?php
    function real_parse_headers($data) {
        $result = [];
        foreach($data as $line) {
            $parts = explode(':', $line, 2);
            if(!isset($parts[1])) continue;
            $key = trim($parts[0]);
            $key = implode('-', array_map(function($value) {return ucfirst($value);}, explode('-', $key)));
            $result[$key] = trim($parts[1]);
        }
        return $result;
    }
    
    function real_length($from, $original_context = null) {
        $context = stream_context_create(isset($original_context) ? stream_context_get_options($original_context) : null);
        stream_context_set_option($context, 'http', 'method', 'HEAD');
        @file_get_contents($from, false, $context);
        return intval(real_parse_headers($http_response_header)['Content-Length']);
    }
    
    function real_copy($from, string $to, $context = null) {
        define('BLOCK', 8192);
        $total = real_length($from, $context);
    
        if(!isset($context)) {
            $context = stream_context_create();
        }
        $headers = stream_context_get_options($context)['http']['header'] ?? [];
        stream_context_set_option($context, 'http', 'timeout', '1.0');
        stream_context_set_option($context, 'http', 'ignore_errors', true);
    
        for($start = 0; $start < $total; $start += $length) {
            $end = $start + BLOCK;
            stream_context_set_option($context, 'http', 'header', array_merge($headers, ["Range: bytes=$start-$end"]));
            $part = @file_get_contents($from, false, $context);
            if($part === false) break;
            $length = strlen($part);
            file_put_contents($to, $part, FILE_APPEND);
        }
    }
    
    /* The real example */
    $context = stream_context_create([
        'http' => ['method' => 'GET'],
        'ssl'  => ['verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, 'SNI_enabled' => true]
    ]);        
    
    real_copy('https://govnokod.ru/files/images/pony.jpg', 'pony.jpg', $context);

    Дрочилка для скачивания файлов с сайтов, расположенных за «Cloudflare». Теперь банановая и на «PHP»!

    nemyx, 25 Июля 2025

    Комментарии (28)
  6. Куча / Говнокод #29160

    0

    1. 1
    Пиздец-оффтоп #113

    #83: https://govnokod.ru/28788 https://govnokod.xyz/_28788
    #84: https://govnokod.ru/28795 https://govnokod.xyz/_28795
    #85: https://govnokod.ru/28808 https://govnokod.xyz/_28808
    #86: (vanished) https://govnokod.xyz/_28814
    #87: https://govnokod.ru/28817 https://govnokod.xyz/_28817
    #88: https://govnokod.ru/28836 https://govnokod.xyz/_28836
    #89: https://govnokod.ru/28843 https://govnokod.xyz/_28843
    #90: https://govnokod.ru/28874 https://govnokod.xyz/_28874
    #91: https://govnokod.ru/28880 https://govnokod.xyz/_28880
    #92: https://govnokod.ru/28884 https://govnokod.xyz/_28884
    #93: https://govnokod.ru/28889 https://govnokod.xyz/_28889
    #94: https://govnokod.ru/28895 https://govnokod.xyz/_28895
    #95: https://govnokod.ru/28904 https://govnokod.xyz/_28904
    #96: https://govnokod.ru/28912 https://govnokod.xyz/_28912
    #97: https://govnokod.ru/28918 https://govnokod.xyz/_28918
    #98: https://govnokod.ru/28932 https://govnokod.xyz/_28932
    #99: https://govnokod.ru/28936 https://govnokod.xyz/_28936
    #100: https://govnokod.ru/28940 https://govnokod.xyz/_28940
    #101: https://govnokod.ru/28949 https://govnokod.xyz/_28949
    #102: https://govnokod.ru/28978 https://govnokod.xyz/_28978
    #103: https://govnokod.ru/28982 https://govnokod.xyz/_28982
    #104: https://govnokod.ru/28989 https://govnokod.xyz/_28989
    #105: https://govnokod.ru/29052 https://govnokod.xyz/_29052
    #106: https://govnokod.ru/29069 https://govnokod.xyz/_29069
    #107: https://govnokod.ru/29086 https://govnokod.xyz/_29086
    #108: https://govnokod.ru/29102 https://govnokod.xyz/_29102
    #109: https://govnokod.ru/29126 https://govnokod.xyz/_29126
    #110: https://govnokod.ru/29136 https://govnokod.xyz/_29136
    #111: https://govnokod.ru/29142 https://govnokod.xyz/_29142
    #112: https://govnokod.ru/29155 https://govnokod.xyz/_29155

    nepeKamHblu_nemyx, 20 Июля 2025

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

    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
    (tagbody
    
      start
        (defun innovative-sort (lst)
          (assert (not (null lst)))
    
          (when (equal (car lst) "VIRGIN") (innovative-sort (reverse (cdr lst))))
    
          (if (> (length lst) 1)
             (let ((foo (logxor
                         (logand
                           (if (> (car lst) (cadr lst))
                              1
                              0)
                         1)
                        (logand
                        (if
                             (not (> (car lst) (cadr lst)))
                       1
                        0)
                        0))))
    
           (if (if (= foo 1) t nil)
                (progn
                  (rotatef (car lst) (cadr lst))
                (cons (car lst) (innovative-sort (cdr lst))))
                (cons (car lst) (innovative-sort (cdr lst)))))
    
            (car lst)))
    
    (go start))
    
    (innovative-sort '(5 9 2 4))

    инновационный алгоритм сортировки

    lisp-worst-code, 19 Июля 2025

    Комментарии (3)
  8. bash / Говнокод #29158

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    #!/bin/sh
    
    while :; do
    wget -c -T 1 --no-check-certificate $1
    [ $? == 0 ] && break
    done

    Дрочилка для скачивания файлов с сайтов, расположенных за «Cloudflare».

    nemyx, 18 Июля 2025

    Комментарии (32)
  9. JavaScript / Говнокод #29157

    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
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    $(document).ready(function(){
    	
    	var formStr = '';
    	
    		formStr +=	'<button type="button" class="btn-close d-none d-md-block" data-bs-dismiss="modal" aria-label="Close"></button>';
    		formStr +=		'<div class="modal-dialog modal-dialog-centered">';
    		formStr +=			'<div class="modal-content">';				
    		formStr +=				'<div class="modal-header position-relative">';			
    		formStr +=					'<button type="button" class="btn-close d-md-none" data-bs-dismiss="modal" aria-label="Close"></button>';			
    		formStr +=					'<div class="modal-header-image"></div>';			
    		formStr +=				'</div>';			
    		formStr +=				'<div class="modal-body">';			
    		formStr +=				'<div class="good-result-text">';			
    		formStr +=					'Ваша заявка успешно принята!';			
    		formStr +=				'</div>';			
    		formStr +=				'<div class="modal-body-title mb-3 text-center">';			
    		formStr +=					'Заявка';			
    		formStr +=				'</div>';			
    		formStr +=				'<div class="mb-4 text-center">';			
    		formStr +=					'Для подачи документов онлайн<br> заполните форму заявки.';			
    		formStr +=				'</div>';			
    		formStr +=				'<div class="mb-4">';			
    		formStr +=					'<form class="modal-form">';			
    		formStr +=						'<div class="modal-form-input-wrapper mb-2">';			
    		formStr +=							'<select name="role-select">';			
    		formStr +=								'<option selected disabled>Кто Вы?</option>';			
    		formStr +=								'<option value="Родитель">Родитель</option>';			
    		formStr +=								'<option value="Абитуриент">Абитуриент</option>';			
    		formStr +=							'</select>';			
    		formStr +=							'<span class="modal-form-input-error">';			
    		formStr +=								'Необходимо выбрать Вашу роль';			
    		formStr +=							'</span>';			
    		formStr +=						'</div>';			
    		formStr +=						'<div class="modal-form-input-wrapper mb-2">';			
    		formStr +=							'<input type="text" autocomplete="name" name="name" value="" placeholder="ФИО:">';			
    		formStr +=							'<span class="modal-form-input-error">';			
    		formStr +=								'Укажите Ваше ФИО';			
    		formStr +=							'</span>';			
    		formStr +=						'</div>';			
    		formStr +=						'<div class="modal-form-input-wrapper mb-2">';			
    		formStr +=							'<input type="tel" autocomplete="phone" name="phone" value="" placeholder="Телефон:">';	
    		formStr +=							'<span class="modal-form-input-error">';			
    		formStr +=								'Укажите Ваш номер телефона';			
    		formStr +=							'</span>';			
    		formStr +=						'</div>';			
    		formStr +=						'<div class="modal-form-input-wrapper mb-2">';			
    		formStr +=							'<input type="email" autocomplete="email" name="email" value="" placeholder="Email:">';			
    		formStr +=							'<span class="modal-form-input-error">';			
    		formStr +=								'Укажите Ваш email';			
    		formStr +=							'</span>';			
    		formStr +=						'</div>';			
    		// formStr +=						'<div class="modal-form-input-wrapper mb-2">';			
    		// formStr +=							'<select name="theme-master-select">';			
    		// formStr +=								'<option selected disabled>Выберите тему мастер-класса</option>';			
    		// formStr +=								'<option value="Погружение во вселенную нейросетей">Погружение во вселенную нейросетей</option>';			
    		// formStr +=								'<option value="Веселый кулинар">Веселый кулинар</option>';			
    		// formStr +=								'<option value="Управление ">Управление </option>';			
    		// formStr +=								'<option value="Эксперт-криминалист: секреты профессии">Эксперт-криминалист: секреты профессии</option>';			
    		// formStr +=								'<option value="В мире финансов:  компас">В мире финансов:  компас</option>';
    		// formStr +=								'<option value="Удивительные отели ">Удивительные отели </option>';
    		// formStr +=								'<option value="В мире профессий. Операционная логистика">В мире профессий. Операционная логистика</option>';
    		// formStr +=							'</select>';			
    		// formStr +=							'<span class="modal-form-input-error">';			
    		// formStr +=								'Необходимо выбрать тему мастер-класса';			
    		// formStr +=							'</span>';			
    		// formStr +=						'</div>	';			
    		formStr +=						'<div class="privacy position-relative mb-3">';			
    		formStr +=							'<label>';			
    		formStr +=								'<input type="checkbox" name="pers-approval" checked>';			
    		formStr +=								'<span class="checkmark"></span>';			
    		formStr +=									'<div class="ps-4">';			
    		formStr +=										'Согласен(-на) на обработку персональных данных, ';			
    		formStr +=										'<a href="/privacy_policy.pdf" target="_blank">политикой конфиденциальности</a>, <a href="/Politika_v_otnoshenii_obrabotki.pdf" target="_blank">политикой в отношении обработки персональных данных</a>';			
    		formStr +=									'</div>';			
    		formStr +=							'</label>';			
    		formStr +=							'<span class="modal-form-input-error">';				
    		formStr +=								'Необходимо Ваше согласие';				
    		formStr +=							'</span>';				
    		formStr +=						'</div>';				
    		formStr +=						'<div>';				
    		formStr +=							'<button type="submit">';				
    		formStr +=								'Отправить';				
    		formStr +=							'</button>';				
    		formStr +=						'</div>';				
    		formStr +=					'</form>';				
    		formStr +=				'</div>';				
    		formStr +=				'<hr>';							
    
    	$('#modalForm').append(formStr);
    
    });

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

    freeman_men, 15 Июля 2025

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

    0

    1. 1
    IT Оффтоп #218

    #188: https://govnokod.ru/28837 https://govnokod.xyz/_28837
    #189: https://govnokod.ru/28840 https://govnokod.xyz/_28840
    #190: https://govnokod.ru/28875 https://govnokod.xyz/_28875
    #191: https://govnokod.ru/28878 https://govnokod.xyz/_28878
    #192: https://govnokod.ru/28886 https://govnokod.xyz/_28886
    #193: https://govnokod.ru/28911 https://govnokod.xyz/_28911
    #194: https://govnokod.ru/28914 https://govnokod.xyz/_28914
    #195: https://govnokod.ru/28917 https://govnokod.xyz/_28917
    #196: https://govnokod.ru/28925 https://govnokod.xyz/_28925
    #197: https://govnokod.ru/28935 https://govnokod.xyz/_28935
    #198: https://govnokod.ru/28938 https://govnokod.xyz/_28938
    #199: https://govnokod.ru/28942 https://govnokod.xyz/_28942
    #200: https://govnokod.ru/28945 https://govnokod.xyz/_28945
    #201: https://govnokod.ru/28948 https://govnokod.xyz/_28948
    #202: https://govnokod.ru/28951 https://govnokod.xyz/_28951
    #203: https://govnokod.ru/28954 https://govnokod.xyz/_28954
    #204: https://govnokod.ru/28971 https://govnokod.xyz/_28971
    #205: https://govnokod.ru/28986 https://govnokod.xyz/_28986
    #206: https://govnokod.ru/28991 https://govnokod.xyz/_28991
    #207: https://govnokod.ru/29002 https://govnokod.xyz/_29002
    #208: https://govnokod.ru/29060 https://govnokod.xyz/_29060
    #209: https://govnokod.ru/29070 https://govnokod.xyz/_29070
    #210: https://govnokod.ru/29079 https://govnokod.xyz/_29079
    #211: https://govnokod.ru/29092 https://govnokod.xyz/_29092
    #212: https://govnokod.ru/29093 https://govnokod.xyz/_29093
    #213: https://govnokod.ru/29104 https://govnokod.xyz/_29104
    #214: https://govnokod.ru/29114 https://govnokod.xyz/_29114
    #215: https://govnokod.ru/29125 https://govnokod.xyz/_29125
    #216: https://govnokod.ru/29132 https://govnokod.xyz/_29132
    #217: https://govnokod.ru/29147 https://govnokod.xyz/_29147

    nepeKamHblu_nemyx, 14 Июля 2025

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