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

    0

    1. 1
    2. 2
    Дум запустили в блокноте.
    https://www.youtube.com/watch?v=mjfj3KIEf9k

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

    guest6_uebok, 10 Октября 2022

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

    0

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

    #27: https://govnokod.ru/27572 https://govnokod.xyz/_27572
    #28: https://govnokod.ru/27580 https://govnokod.xyz/_27580
    #29: https://govnokod.ru/27738 https://govnokod.xyz/_27738
    #30: https://govnokod.ru/27751 https://govnokod.xyz/_27751
    #31: https://govnokod.ru/27754 https://govnokod.xyz/_27754
    #32: https://govnokod.ru/27786 https://govnokod.xyz/_27786
    #33: https://govnokod.ru/27801 https://govnokod.xyz/_27801
    #34: https://govnokod.ru/27817 https://govnokod.xyz/_27817
    #35: https://govnokod.ru/27822 https://govnokod.xyz/_27822
    #36: https://govnokod.ru/27826 https://govnokod.xyz/_27826
    #37: https://govnokod.ru/27827 https://govnokod.xyz/_27827
    #38: https://govnokod.ru/27833 https://govnokod.xyz/_27833
    #39: https://govnokod.ru/27862 https://govnokod.xyz/_27862
    #40: https://govnokod.ru/27869 https://govnokod.xyz/_27869
    #41: https://govnokod.ru/27933 https://govnokod.xyz/_27933
    #42: (vanished) https://govnokod.xyz/_27997
    #43: https://govnokod.ru/28042 https://govnokod.xyz/_28042
    #44: https://govnokod.ru/28080 https://govnokod.xyz/_28080
    #45: https://govnokod.ru/28086 https://govnokod.xyz/_28086
    #46: https://govnokod.ru/28105 https://govnokod.xyz/_28105
    #47: https://govnokod.ru/28166 https://govnokod.xyz/_28166
    #48: https://govnokod.ru/28229 https://govnokod.xyz/_28229
    #49: https://govnokod.ru/28298 https://govnokod.xyz/_28298
    #50: https://govnokod.ru/28308 https://govnokod.xyz/_28308
    #51: https://govnokod.ru/28329 https://govnokod.xyz/_28329
    #52: https://govnokod.ru/28340 https://govnokod.xyz/_28340
    #53: (vanished) https://govnokod.xyz/_28346
    #54: https://govnokod.ru/28353 https://govnokod.xyz/_28353
    #55: https://govnokod.ru/28361 https://govnokod.xyz/_28361
    #56: https://govnokod.ru/28383 https://govnokod.xyz/_28383

    nepeKamHblu_nemyx, 09 Октября 2022

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

    −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
    template<typename ProcessT, typename... Args>
    			requires (!std::derived_from<ProcessT, Process<ProcessT>>)
    		ProcessT& startProcess(processing::Processor& processor, Args&&... args)
    		{	
    			processor.template getProcess<ProcessT>(processor.template attach<ProcessT>(args...));
    		}
    
    		template<typename ProcessT, typename... Args>
    			requires std::derived_from<ProcessT, Process<ProcessT>>
    		ProcessT& startProcess(processing::Processor& processor, Args&&... args)
    		{
    			processor.template getProcess<ProcessT>(processor.template attach<ProcessT>(
    				static_cast<T*>(this)->entity, args...));
    		}

    Ко мне вернулось вдохновение

    kcalbCube, 08 Октября 2022

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

    +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
    class FileCheckError(Exception):
    
        def __init__(self, check, file):
            self.check = check
            self.file = file
            self.exceptions = ['не является файлом',
                               'не является .wav файлом',
                               'не находится в списке требуемых сэмплов',]
    
        def __str__(self):
            return f'{self.file} {self.exceptions[self.check]}'
    
    
    def validate_pack(pack) -> list:
        """
        Checks for invalid files in a pack folder
        Makes a list of invalid files if found any or
        makes a list of accepted samples
        """
        accepted_samples = []
        found_errors = []
    
        for sample in listdir(pack):
            checks = [isfile(join(pack, sample)),
                      fnmatch(sample, '*.wav'),
                      Path(pack / sample).stem in required_samples, ]
            try:
                for check in range(len(checks)):
                    if not checks[check]:
                        raise FileCheckError(check=check, file=sample)
            except FileCheckError as E:
                found_errors.append(str(E))
                continue
    
            accepted_samples.append(sample)
    
        if len(found_errors) != 0:
            return found_errors
        else:
            return accepted_samples
    
    result = validate_pack(Path('drumpacks/rock'))
    print(result, sep='\n')

    rockkley94, 07 Октября 2022

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

    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
    public static LanguageLevel fromPythonVersion(@Nullable String pythonVersion) {
        if (pythonVersion == null) return null;
    
        if (pythonVersion.startsWith("2")) {
          if (pythonVersion.startsWith("2.4")) {
            return PYTHON24;
          }
          if (pythonVersion.startsWith("2.5")) {
            return PYTHON25;
          }
          if (pythonVersion.startsWith("2.6")) {
            return PYTHON26;
          }
          if (pythonVersion.startsWith("2.7")) {
            return PYTHON27;
          }
          return DEFAULT2;
        }
        if (pythonVersion.startsWith("3")) {
          if (pythonVersion.startsWith("3.0")) {
            return PYTHON30;
          }
          if (pythonVersion.startsWith("3.1.") || pythonVersion.equals("3.1")) {
            return PYTHON31;
          }
          if (pythonVersion.startsWith("3.2")) {
            return PYTHON32;
          }
          if (pythonVersion.startsWith("3.3")) {
            return PYTHON33;
          }
          if (pythonVersion.startsWith("3.4")) {
            return PYTHON34;
          }
          if (pythonVersion.startsWith("3.5")) {
            return PYTHON35;
          }
          if (pythonVersion.startsWith("3.6")) {
            return PYTHON36;
          }
          if (pythonVersion.startsWith("3.7")) {
            return PYTHON37;
          }
          if (pythonVersion.startsWith("3.8")) {
            return PYTHON38;
          }
          if (pythonVersion.startsWith("3.9")) {
            return PYTHON39;
          }
          if (pythonVersion.startsWith("3.10")) {
            return PYTHON310;
          }
          if (pythonVersion.startsWith("3.11")) {
            return PYTHON311;
          }
          return DEFAULT3;
        }
        return getDefault();
      }

    https://github.com/JetBrains/intellij-community/blob/07cef3c4397f026a5f7aa26e783b0bf7dfee5ab2/python/python-psi-api/src/com/jetbrains/python/psi/LanguageLevel.java#L125

    DypHuu_niBEHb, 05 Октября 2022

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

    −10

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    public static String padRight(String s, int n) {
         return String.format("%-" + n + "s", s);  
    }
    
    public static String padLeft(String s, int n) {
        return String.format("%" + n + "s", s);  
    }

    How can I pad a String in Java?
    https://stackoverflow.com/questions/388461/how-can-i-pad-a-string-in-java/391978

    Все ответы восхитительны в своей коричневости.

    ISO, 05 Октября 2022

    Комментарии (20)
  7. Python / Говнокод #28398

    −4

    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
    a = float(input())
    b = float(input())
    
    operation = input()
    if operation == '+':
        print(a + b)
    elif operation == '-':
        print(a-b)
    elif operation == '*':
        print(a*b)
    elif operation == '/':
        print (a /b)
    elif operation == 'mod':
        print(a%b)
         if b == 0:
            print ("Деление на 0!")
    elif operation == 'div':
        print(a//b)
    elif operation == 'pow':
        print(a**b)

    Шикарный калькулятор

    rootOtotot, 05 Октября 2022

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

    −7

    1. 1
    ВремяВыезда = Строка(Формат(ВыборкаМаршШапка[0].ВремяВыезда, "ДФ=ЧЧ")) + ":" + Строка(Формат(ВыборкаМаршШапка[0].ВремяВыезда, "ДФ=мм")) + " выезд из гар.";

    Выводит время без секунд

    serving12, 04 Октября 2022

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

    −6

    1. 1
    Политота #17

    #1: https://govnokod.ru/15804 https://govnokod.xyz/_15804
    #2: https://govnokod.ru/19910 https://govnokod.xyz/_19910
    #3: https://govnokod.ru/23643 https://govnokod.xyz/_23643
    #4: (vanished) https://govnokod.xyz/_24822
    #5: https://govnokod.ru/24868 https://govnokod.xyz/_24868
    #6: (vanished) https://govnokod.xyz/_26648
    #7: https://govnokod.ru/26673 https://govnokod.xyz/_26673
    #8: https://govnokod.ru/27052 https://govnokod.xyz/_27052
    #9: https://govnokod.ru/27852 https://govnokod.xyz/_27852
    #10: https://govnokod.ru/28060 https://govnokod.xyz/_28060
    #11: https://govnokod.ru/28091 https://govnokod.xyz/_28091
    #12: https://govnokod.ru/28103 https://govnokod.xyz/_28103
    #13: https://govnokod.ru/28144 https://govnokod.xyz/_28144
    #14: https://govnokod.ru/28270 https://govnokod.xyz/_28270
    #15: https://govnokod.ru/28341 https://govnokod.xyz/_28341
    #16: https://govnokod.ru/28379 https://govnokod.xyz/_28379

    nepeKamHblu_nemyx, 03 Октября 2022

    Комментарии (459)
  10. Go / Говнокод #28393

    −4

    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
    // first is information about the first byte in a UTF-8 sequence.
    var first = [256]uint8{
    	//   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x00-0x0F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x10-0x1F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x20-0x2F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x30-0x3F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x40-0x4F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x50-0x5F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x60-0x6F
    	as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x70-0x7F
    	//   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
    	xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0x80-0x8F
    	xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0x90-0x9F
    	xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0xA0-0xAF
    	xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0xB0-0xBF
    	xx, xx, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, // 0xC0-0xCF
    	s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, // 0xD0-0xDF
    	s2, s3, s3, s3, s3, s3, s3, s3, s3, s3, s3, s3, s3, s4, s3, s3, // 0xE0-0xEF
    	s5, s6, s6, s6, s7, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0xF0-0xFF
    }

    как вы уже догадались, это у тэ эф восемь

    "as" это as is
    xx -- хуйня хуёвая
    s1 -- size1 и пр

    Такое вот табличное программирование

    DypHuu_niBEHb, 03 Октября 2022

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