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

    В номинации:
    За время:
  2. Куча / Говнокод #28617

    +3

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    Итак, оказалось, что нас всего трое-четверо, не считая меня и временно съебнувших.
    1. Инканус владеет большинством петушков и файкой Лолечка. Особо не переживает по поводу утраты фаек, ибо у него их - куры не клюют.
    
    2. Человек под ником guest6. Перманент. Шанс того, что под этой файкой сидит несколько хуйцов столь мизерный, что не примем его в счёт. 
    Несмотря на острый ум, довольно ограничен и имеет узкий кругозор. Также ему свойственны резкие скачки настроения. 
    Я долго пытался угадать его знак зодиака, но впал в сомнения. Что-то из этого: [Скорпион. Дева. Стрелец].
    
    3. Некто, владеющий soul_re@ver и прочими, с анимешной авой.

    Расследование продолжается.

    Support, 28 Февраля 2023

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

    +4

    1. 1
    2. 2
    Мдас. Нелегко глядеть в глаза родителя, с чьим чей сынишкой у тебя отношения... Проблема в том, что с отцом мы тоже... друзья. 
    Сложно сказать, догадывается папаша или нет, и вызвана ли эта улыбка радостью за своего ребенка или холодком подозрений.

    Такой скотиной себя давно не чувствовал.

    Support, 17 Февраля 2023

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

    0

    1. 1
    2. 2
    var width = $(window).width(), check;
    width > 950 ? check = true : check = false;

    Snake911, 30 Ноября 2022

    Комментарии (6)
  5. 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)
  6. 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)
  7. Си / Говнокод #28289

    −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
    #define BITS 8
    
    typedef union
    {
        int v;
        struct 
        {
            #define FIELD(x,_) int b##x:1;        
            EVAL(REPEAT(BITS, FIELD, ~))
            #undef FIELD
        };
    } Num;
    
    Num shl(Num n, int carry)
    {
        #define SHIFTL(x,_) CAT(n.b, CAT(x = n.b, CAT(DEC_,x)));    
        EVAL(RREPEAT(BITS, SHIFTL, ~))
        #undef SHIFTL
        n.b0 = carry;
    }
    
    Num shr(Num n, int carry)
    {
        #define SHIFTR(x,_) CAT(n.b, CAT(CAT(DEC_,x) = n.b, x));
        EVAL(REPEAT(BITS, SHIFTR, ~))
        #undef SHIFTR
        CAT(n.b, CAT(DEC_,BITS)) = carry;
    }
    
    
    int main()
    {
        for (int i=0; i<33; ++i){
            Num n   = {i};
            Num n1 = shl(n,0);
            Num n2 = shr(n,0);        
            printf("%d %d %d\n",n ,n1 , n2);
        }
    }

    https://godbolt.org/z/48h6EWacY

    Двунаправленный сдвиговый регистр на препроцессоре.
    Сделан без использования арифметических действий.

    3.14159265, 21 Июля 2022

    Комментарии (6)
  8. Pascal / Говнокод #28215

    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
    // реализация интерфейса IArguments2 для самодельного скриптового движка, aka vbs to exe
    
    unit Arguments;
    
    interface
    
    uses
      Windows, ComObj, ActiveX, Stub_TLB, SysUtils,WSHNamedArguments,WSHUnNamedArguments, CmdUtils;
    
    type
      TIarguments=class(TAutoObject, IArguments2, IEnumVariant)
          FAArgs:array of WideString;
          FWSHNamedArguments:TIWSHNamedArguments;
          FWSHUnNamedArguments:TIWSHUnNamedArguments;
          function Item(Index: Integer): WideString; safecall;
        function Count: Integer; safecall;
        function Get_length: Integer; safecall;
        function _NewEnum: IUnknown; safecall;
        property length: Integer read Get_length;
            function Get_Named: IWSHNamedArguments; safecall;
        function Get_Unnamed: IWSHUnnamedArguments; safecall;
        procedure ShowUsage; safecall;
        property Named: IWSHNamedArguments read Get_Named;
        property Unnamed: IWSHUnnamedArguments read Get_Unnamed;
            function Next(celt: LongWord; var rgvar : OleVariant;
          out pceltFetched: LongWord): HResult; stdcall;
        function Skip(celt: LongWord): HResult; stdcall;
        function Reset: HResult; stdcall;
        function Clone(out Enum: IEnumVariant): HResult; stdcall;
        public
        constructor Create;
        end;

    implementation

    uses ComServ;

    var
    FIndex:Integer=0;

    { TIarguments }

    function TIarguments._NewEnum: IUnknown;
    begin
    Result:=self;
    end;

    function TIarguments.Count: Integer;
    begin
    Result:=System.Length(FAArgs);
    end;

    function TIarguments.Get_length: Integer;
    begin
    Result:=Count;
    end;

    function TIarguments.Item(Index: Integer): WideString;
    begin
    if (Index >= System.Length(FAArgs)) then
    raise EOleSysError.Create('Range check error', HRESULT($800A0009),0)
    else
    Result:=FAArgs[Index]
    end;

    function TIarguments.Get_Named: IWSHNamedArguments;
    begin
    Result:=FWSHNamedArguments;
    end;

    function TIarguments.Get_Unnamed: IWSHUnnamedArguments;
    begin
    Result:=FWSHUnNamedArguments;
    end;

    procedure TIarguments.ShowUsage;
    begin
    OleError(E_NOTIMPL);
    end;

    constructor TIarguments.Create;
    var
    I,J, PCnt:Integer;
    S, CmdLine:string;
    begin
    inherited Create;
    FIndex:=0;
    FWSHNamedArguments:=TIWSHNamedArguments.Create;
    FWSHUnNamedArguments:=TIWSHUnNamedArguments.Create;
    PCnt:=ParamCount;
    SetLength(FAArgs, PCnt);
    for I:=1 to PCnt do
    begin
    J:=I-1;
    FAArgs[J]:=ParamStr(I);
    end;

    //Parsing named args.

    CmdLine:='';
    S:=GetCommandLine;
    PCnt:=iParamCount(PChar(S));
    if PCnt > 1 then
    begin
    for I:=1 to PCnt-1 do
    begin
    CmdLine:=CmdLine+iParamStr(PChar(S), I);
    if I < PCnt-1 then
    CmdLine:=CmdLine+' ';
    end;
    end;

    Support, 09 Июня 2022

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

    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
    // Takes a printf-style format string and returns a formatted string.
    char *format(char *fmt, ...) {
      char *buf;
      size_t buflen;
      FILE *out = open_memstream(&buf, &buflen);
    
      va_list ap;
      va_start(ap, fmt);
      vfprintf(out, fmt, ap);
      va_end(ap);
      fclose(out);
      return buf;
    }

    kcalbCube, 25 Февраля 2022

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

    +1

    1. 1
    2. 2
    if x == 2 or 3: # если x равен 2 или 3
        print('Пыщь.')

    Вот уже не впервый раз натыкаюсь на подобный "машинный перевод с русского на питон".

    Vindicar, 25 Февраля 2022

    Комментарии (6)
  11. Си / Говнокод #28041

    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
    void pong_game(void)
       {
          /*Set the first random direction the ball will be traviling*/
          direction=random_direction();
          
          /*Play the game while the ESC key is not pressed*/
          while(!key[KEY_ESC]) {
             /*Move the Ball*/
             move_ball();
             /*Respond to the input*/
             key_respond();
             
             /*Put the information on the Screen*/
             textout(buffer,pong_datafile[pong_text].dat,"Player 1 Score:",
                     150,0,254);
             textout(buffer,pong_datafile[pong_text].dat,itoa(score_p1,NULL,10),
                     text_length(pong_datafile[pong_text].dat,
                     "Player 1 Score:")+150,0,10);
             textout(buffer,pong_datafile[pong_text].dat,"Player 2 Score:",
                     350,0,254);
             textout(buffer,pong_datafile[pong_text].dat,itoa(score_p2,NULL,10),
                     text_length(pong_datafile[pong_text].dat,
                                 "Player 2 Score:")+350,0,10);
             textout(buffer,pong_datafile[pong_text].dat,"keyboard",0,0,255);
             textout(buffer,pong_datafile[pong_text].dat,"joystick",
                     640-text_length(pong_datafile[pong_text].dat,"joystick"),
                     0,255);
             /*Draw a line to set the boundries*/
             line(buffer,0,30,640,30,10);
             
             /*Put the buffer screen on the screen*/
             blit(buffer,screen,0,0,0,0,640,480);
             
             /*Clear the buffer*/
             clear(buffer);
          }
          return;
       }

    помните?

    kcalbCube, 20 Февраля 2022

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