1. C# / Говнокод #25422

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    foreach (var form1 in Volume.Form)
                {
                    int nameCount = 0;
    
                    foreach (var form2 in Volume.Form)
                    {
                        if (form2.Name.Equals(form1.Name) && ++nameCount > 1)
                        {
                            throw new VolumeConfigurationException($"Form with name \"{form1.Name}\" already exists.");
                        }
                    }

    вот скажите мне
    как программисты программисту
    вот как рука поднимается такое вот писать:

    spam537, 04 Марта 2019

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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    enet_uint32 flags = 0;
    
    if (flags & CPacket::RELIABLE)
        flags |=ENET_PACKET_FLAG_RELIABLE;
    
    return enet_packet_create(data, (writer.Tell() + 7) / 8, flags);

    Братишка сделал одинаковые названия локальной переменной и поля в классе.

    tuxick, 03 Марта 2019

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

    −104

    1. 1
    2. 2
    Кто победит на выборах?
    Я за Зеленского. Чисто по приколу.

    nOJlumu4ecKuu_nemyx, 02 Марта 2019

    Комментарии (84)
  4. Куча / Говнокод #25419

    0

    1. 1
    git https://u.to/4JrPFA

    Оригинал http://govnokod.ru/25418

    3_15dar, 02 Марта 2019

    Комментарии (7)
  5. Куча / Говнокод #25418

    −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
    @charset "UTF-8";
    
    /*!
     * 文件名称:Hui.css
     * 文件版本:Version 0.3.4    2016-05-18
     * 文件作者:新生帝
     * 编写日期:2016年04月15日
     * 版权所有:中山赢友网络科技有限公司
     * 企业官网:http://www.winu.net
     * 开源协议:MIT License
     * 文件描述:一切从简,只为了更懒!
     * 讨论群区:一起改变中国IT教育 18863883
     * 开源地址:https://git.oschina.net/winu.net/Hui.git
     */

    3_15dar, 02 Марта 2019

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

    0

    1. 1
    https://docs.kartina.tv/#api-_footer

    Английский, уровень - бог. И это самый популярное у нас интернет тв с подпиской минимум за 16,5€/мес.

    syoma, 28 Февраля 2019

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

    0

    1. 1
    Просто оффтоп #3

    #1: https://govnokod.xyz/_20162 https://govnokod.ru/20162
    #2: https://govnokod.xyz/_25329 https://govnokod.ru/25329

    syoma, 27 Февраля 2019

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

    +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
    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
    <?php
    
    namespace AppHttpControllers;
    
    use AppModelsCardUserModel;
    use IlluminateHttpRequest;
    use AppModelsUserModel;
    use AppModelsArenaBattleModel;
    use AppModelsArenaCardsModel;
    use Auth;
    use Services;
    
    class ArenaController extends Controller
    {
        public function index()
        {
            $issetBattle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id)->count();
            if($issetBattle == 0)
            {
                $result = 'Начать подбор противника!<br>
                <a href="/arena/find" class="btn btn-games2 btn-block">Искать</a>';
            }
            else
            {
                $battle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id)->first();
                if($battle->status == 'card1_pick') return redirect('/arena/pick/1');
                if($battle->status == 'card2_pick') return redirect('/arena/pick/2');
                if($battle->status == 'battle') return redirect('/arena/battle');
                if($battle->status == 'result') return redirect('/arena/result');
                if($battle->user1 == Auth::user()->id) $opponent = $battle->user2;
                else $opponent = $battle->user1;
                if($opponent == 0) $result = 'Идёт поиск противника!<br>
                <a href="/arena/cancel" class="btn btn-games2 btn-block">Отменить поиск</a>';
                else
                {
                    if($battle->start_time < time())
                    {
                        $battle->status = 'card1_pick';
                        $battle->save();
                        return redirect('/arena/pick/1');
                    }
                    $result = 'Противник найден!<br>
                    '.($battle->start_time-time() > 0 ? 'До начала боя: '.Services::timer($battle->start_time-time()).'<br>' : 'Бой начался!<br>').'
                    <a href="/arena/cancel" class="btn btn-games2 btn-block">Отменить поиск</a>';
                }
            }
            return view('game.battles.arena.index', ['result' => $result]);
        }
    
        public function find()
        {
            $issetBattle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id)->count();
            if($issetBattle > 0) return back()->with('error', 'Подбор уже начат!');
            $battles = ArenaBattleModel::where('status', 'prepare')->where('user2', 0)->inRandomOrder();
            $myMaxCardLevel = Services::getMaxCardLevel(Auth::user()->id);
            if($battles->count() == 0)
            {
                ArenaBattleModel::create([
                    'user1' => Auth::user()->id,
                    'card_level' => $myMaxCardLevel+1
                ]);
                return back()->with('ok', 'Поиск противника начат!');
            }
            else
            {
                $battles = $battles->first();
                if($battles->card_level-1 > $myMaxCardLevel) $battles->card_level = $myMaxCardLevel+1;
                $battles->user2 = Auth::user()->id;
                $battles->start_time = time()+30;
                $battles->save();
                return back()->with('ok', 'Противник найден!');
            }
        }
    
        public function cancelFind()
        {
            $issetBattle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id);
            if($issetBattle->count() == 0) return back()->with('error', 'Подбор ещё не начат!');
            $foundBattle = $issetBattle->first();
            if($foundBattle->user1 == Auth::user()->id) $foundBattle->delete();
            else
            {
                $opponentMaxCardLevel = Services::getMaxCardLevel($foundBattle->user1);
                if($opponentMaxCardLevel != $foundBattle->card_level) $foundBattle->card_level = $opponentMaxCardLevel+1;
                $foundBattle->user2 = 0;
                $foundBattle->save();
            }
            return back();
        }
    }
    // и еще 10кб кода

    код игры на Laravel . Вкусняшка

    eskrano, 27 Февраля 2019

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

    +1

    1. 1
    return new JsonResponse(['message'=>'You cannot appoint your child as a parent'],400);

    123456Aa

    quant61, 26 Февраля 2019

    Комментарии (0)
  10. JavaScript / Говнокод #25412

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    var text_message = "";	
    text_message += "\n Вопрос №1: " + $('input[name=question_0]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_0]:checked').val();
    text_message += "\n Вопрос №2: " + $('input[name=question_1]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_1]:checked').val();
    text_message += "\n Вопрос №3: " + $('input[name=question_2]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_2]:checked').val();
    text_message += "\n Вопрос №4: " + $('input[name=question_3]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_3]:checked').val();
    text_message += "\n Вопрос №5: " + $('input[name=question_4]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_4]:checked').val();
    text_message += "\n Вопрос №6: " + $('input[name=question_5]:checked').parent().parent().parent().find(".title").text() + " Ответ: " + $('input[name=question_5]:checked').val();

    ууууиииииии

    ishurgaya, 26 Февраля 2019

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