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

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    #pragma once
    
    #define ENUM_DECLARE_BEGIN(enum_class, enum_value) \
    class enum_class##__enum__##enum_value : public enum_class {
    
    #define ENUM_DECLARE_END(enum_class, enum_value) \
    }; extern const enum_class##__enum__##enum_value enum_value;
    
    #define ENUM_DEFINE(enum_class, enum_value, enum_namespace) const enum_class##__enum__##enum_value enum_namespace enum_value;

    UsernameAK, 10 Февраля 2019

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

    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
    Подключить (Написать/Вывести на экран)
    
    Точка старта
    выбор (любое)
    счётчик (только цыферка) равен 0
    написать выбор
    Если выбор (статус цыферка) то выбор (теперь буковка)
    Пока выбор не равен буковка(А или Б или В)
      Делать вот это
      Если счётчик больше 9 то Аварийное завершение
      написать выбор
      прибавить 1 к счётчик
      До сюда
    Вывести выбор и счётчик
    Удалить выбор и счётчик
    Точка завершения

    C/C++ подобный псевдокод на русском с dynamic/static типизацией

    BelCodeMonkey, 06 Января 2019

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

    0

    1. 1
    $ 67.18

    Ksyrx, 06 Января 2019

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

    −2

    1. 1
    Нам нужен бойцовый петух.

    Петухинхо

    bit0rez, 05 Января 2019

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

    −2

    1. 1
    2. 2
    Решил я зайти на сайт и увидел в адресе .php.
    Больше я не заходил на этот сайт.

    Ksyrx, 03 Января 2019

    Комментарии (7)
  7. 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)
  8. PHP / Говнокод #25177

    −1

    1. 1
    2. 2
    Кода не осталось, только скрин:
    https://i.imgur.com/cyehTUH.jpg

    bochkarev, 10 Декабря 2018

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

    +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
    #include <stdio.h>
    #include <inttypes.h>
    #include <string.h>
    
    typedef struct
    {
      uint8_t arr[10];
      uint8_t pos;
      uint8_t is_swap;
    } arr10;
    
    arr10 bubble_sort_recursion(arr10 a);
    void bubble_sort (uint8_t arr[static 10]);
    
    
    void bubble_sort (uint8_t arr[static 10])
    {
      arr10 a;
      memcpy(a.arr, arr, sizeof(a.arr));
      a.pos = 0;
      a.is_swap = 0;
      a = bubble_sort_recursion(a);
      memcpy(arr, a.arr, sizeof(a.arr));
    }
    
    arr10 bubble_sort_recursion(arr10 a)
    {
      if (a.pos != 9)
      {
        if (a.arr[a.pos] > a.arr[a.pos + 1])
        {
          uint8_t tmp = a.arr[a.pos + 1];
          a.arr[a.pos + 1] = a.arr[a.pos];
          a.arr[a.pos] = tmp;
          a.is_swap = 1;
        }
        a.pos++;
        return bubble_sort_recursion(a);
      }
      else
      {
       if (a.is_swap == 0)
       {
         return a;
       }
       else
       {
         a.pos = 0;
         a.is_swap = 0;
         return bubble_sort_recursion(a);
       }
      }
    }
    
    int main(void)
    {
      uint8_t arr[10] = {244, 90, 254, 109, 33, 85, 69, 81, 126, 71};
      bubble_sort(arr);
      printf("%" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8 ", %" PRIu8,
             arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6], arr[7], arr[8], arr[9]);
      return 0;
    }

    Рекурсивная сортировка пузырьком

    j123123, 29 Ноября 2018

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

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    public static function findById($id)
        {
            $model = self::where('id', $id)->get();
    
            $count = $model->getIterator()->count();
            if($count > 0) {
                return $model->getIterator()->current();
            }
    
            return false;
        }

    Laravel Eloquent Model

    pb92, 11 Октября 2018

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

    −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
    22. 22
    23. 23
    func (incident Incident) DeleteResponsibleMicroservices(microservices []string) {
    	var teamsDelete []string
    	responsibleMss := incident.GetResponsibleMicroservices()
    	for _, microservice := range microservices {
    	ResponsibleMssLoop:
    		for _, responsibleMs := range responsibleMss {
    			if microservice == responsibleMs.MicroserviceId {
    				service.GetInstanceDB().Delete(responsibleMs)
    				if team, ok := GetTeamByMs(microservice); ok != false {
    					for _, ms := range incident.GetResponsibleMicroservices() {
    						if teamFind, ok := GetTeamByMs(ms.MicroserviceId); ok != false && teamFind == team {
    							continue ResponsibleMssLoop
    						}
    					}
    					teamsDelete = append(teamsDelete, team)
    				}
    			}
    		}
    	}
    	if len(teamsDelete) > 0 {
    		incident.DeleteResponsibles(teamsDelete)
    	}
    }

    Отличное читается код на Golang

    prostohz, 09 Октября 2018

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