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

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

    +2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    -- Pipe Elbow ****************************************************************************
    pipe_elbow = util.table.deepcopy(data.raw["storage-tank"]["storage-tank"])
    pipe_elbow.name = "pipe-elbow"
    pipe_elbow.icon = "__Flow Control__/graphics/icon/pipe-elbow.png"
    pipe_elbow.minable = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].minable
    pipe_elbow.corpse = "small-remnants"
    pipe_elbow.max_health = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].max_health
    pipe_elbow.resistances = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].resistances
    pipe_elbow.fast_replaceable_group = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].fast_replaceable_group
    pipe_elbow.collision_box = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].collision_box
    pipe_elbow.selection_box = data.raw["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"]["pipe"].selection_box

    Пип Еблов.
    Factorio mod Flow Control_3.0.3
    --Завышеное ЧСВ или самолюбование?

    TOPT, 04 Января 2019

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

    +2

    1. 1
    Только не это! Нет! Пожалуйста, не надо!!!

    Ну ты питух...

    ne4eHb, 31 Декабря 2018

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

    +2

    1. 1
    2. 2
    3. 3
    https://www.researchgate.net/publication/325358150_cQASM_v10_Towards_a_Common_Quantum_Assembly_Language
    
    cQASM v1.0: Towards a Common Quantum Assembly Language

    The quantum assembly language (QASM) is a popular intermediate representation used in many quantum compilation and simulation tools to describe quantum circuits. Currently, multiple different dialects of QASM are used in different quantum computing tools. This makes the interaction between those tools tedious and time-consuming due to the need for translators between theses different syntaxes. Beside requiring a multitude of translators, the translation process exposes the constant risk of loosing information due to the potential incompatibilities between the different dialects. Moreover, several tools introduce details of specific target hardware or qubit technologies within the QASM syntax and prevent porting the code to other hardwares. In this paper, we propose a common QASM syntax definition, named cQASM, which aims to abstract away qubit technology details and guarantee the interoperability between all the quantum compilation and simulation tools supporting this standard. Our vision is to enable an extensive quantum computing toolbox shared by all the quantum computing community.

    Вот это я понимаю, а то вон там мелкософт какие-то говношарпы придумывает очередные:

    https://docs.microsoft.com/en-us/quantum/language/?view=qsharp-preview


    Нахер ваши шарпы с вашим сраным дуднетом и прочей такой хуйней, даешь Assembler.

    j123123, 28 Декабря 2018

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

    +2

    1. 1
    2. 2
    Дайте инвайт этому господину
    https://habr.com/sandbox/125898/

    LinuxGovno, 27 Декабря 2018

    Комментарии (5)
  6. Assembler / Говнокод #25228

    +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
    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
    /*
    x86-64 clang (trunk) -O3
    https://godbolt.org/z/t8NDGG
    
    #include <inttypes.h>
    
    uint32_t saturation_add(uint32_t a, uint32_t b)
    {
        const uint64_t tmp = (uint64_t)a + b;
        if (tmp > UINT32_MAX)
        {
            return UINT32_MAX;
        }
        return tmp;
    }
    */
    
    saturation_add:
            mov     edx, esi
            mov     eax, edi
            add     edi, esi
            add     rax, rdx
            mov     edx, 4294967295
            cmp     rax, rdx
            mov     eax, -1   // ЗАЧЕМ???
            cmovbe  eax, edi
            ret

    https://en.wikipedia.org/wiki/Saturation_arithmetic
    Почему компиляторы до сих пор такое говно

    j123123, 26 Декабря 2018

    Комментарии (94)
  7. PHP / Говнокод #25224

    +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
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    <?php
        function japanize($s) {
            $syl = array('н',
                'а','ка','са','та','на','ха','ма','я','ра','ва','га','дза','да','ба','па',
                'и','ки','си','ти','ни','хи','ми','и','ри',     'ги','дзи',     'би','пи',
                'у','ку','су','цу','ну','фу','му','ю','ру',     'гу','дзу',     'бу','пу',
                'э','кэ','сэ','тэ','нэ','хэ','мэ','е','рэ',     'гэ','дзэ','дэ','бэ','пэ',
                'о','ко','со','то','но','хо','мо','ё','ро','во','го','дзо','до','бо','по',
                    'кя','ся','тя','ня','хя','мя',    'ря',     'гя','дзя',     'бя','пя',
                    'кю','сю','тю','ню','хю','мю',    'рю',     'гю','дзю',     'бю','пю',
                    'кё','сё','тё','нё','хё','мё',    'рё',     'гё','дзё',     'бё','пё'
            );
            $modulo = count($syl);
            $parts = str_split(substr(sha1($s), 0, 16), 2);
            array_walk($parts, function(&$value, $key) use($syl, $modulo) {$value = $syl[intval($value, 16) % $modulo];});
            return implode('', $parts);
        }
         
        echo japanize('bormand') . PHP_EOL;

    Куд-кудах:
    https://ideone.com/l3WdCD

    nemyx, 26 Декабря 2018

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

    +2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    <?php
    
    class   {
    	function greet()
    	{
    		echo "PHP - govno.\n";
    	}
    }
    
    (new  )->greet();

    https://ideone.com/hzJGW8

    utikeev, 24 Декабря 2018

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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    luabind::object FlowerEventModel::RewardInfo(int index) const {
    		luabind::object result = luabind::newtable(Core::luaState);
    		if (index < 0 && index >= (int)_presents.size()) {
    			return result;
    		}
    		return result;
    	}

    updart, 24 Декабря 2018

    Комментарии (7)
  10. Си / Говнокод #25216

    +2

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    #include <stdio.h>
    
    typedef int return;
    typedef char *break;
    typedef return continue(return argc, break *argv);
    
    continue main
    {
        break s = "Именно поэтому я за \"Си\"";
        puts(s);
    }

    В моём любимом tcc работает

    Morgoth, 22 Декабря 2018

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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    СообщениеСМС = Перечисления.СостоянияСообщенияSMS.Исходящее;
    		Для каждого СообщениеСМС Из СообщениеSMS.Услуги Цикл
    			СообщениеСМС.СостояниеСообщения = Перечисления.СостоянияСообщенияSMS.Исходящее;
    		КонецЦикла;

    1С:Медицина. Поликлинка

    gk-5ccd112a, 21 Декабря 2018

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