1. JavaScript / Говнокод #26967

    0

    1. 1
    <img alt="[object Object]" title="[object Object]" loading="lazy">

    https://beru.ru/catalog/avtotovary/76688?hid=90402 , когда смог в жс на бэкэнде

    phpBidlokoder2, 21 Сентября 2020

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

    0

    1. 1
    Питушня #8

    #1: https://govnokod.ru/26692 https://govnokod.xyz/_26692
    #2: https://govnokod.ru/26891 https://govnokod.xyz/_26891
    #3: https://govnokod.ru/26893 https://govnokod.xyz/_26893
    #4: https://govnokod.ru/26935 https://govnokod.xyz/_26935
    #5: (vanished) https://govnokod.xyz/_26954
    #6: (vanished) https://govnokod.xyz/_26956
    #7: https://govnokod.ru/26964 https://govnokod.xyz/_26964

    nepeKamHblu_nemyx, 21 Сентября 2020

    Комментарии (2317)
  3. JavaScript / Говнокод #26965

    +1

    1. 1
    Чем пакеты "npm" лучше старых добрых плагинов "jQuery"?

    Плагины зависели только от самого "jQuery", а пакеты волокут за собою десятки и сотни левых говен.

    rotoeb, 20 Сентября 2020

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

    +1

    1. 1
    Питушня #7

    #1: https://govnokod.ru/26692 https://govnokod.xyz/_26692
    #2: https://govnokod.ru/26891 https://govnokod.xyz/_26891
    #3: https://govnokod.ru/26893 https://govnokod.xyz/_26893
    #4: https://govnokod.ru/26935 https://govnokod.xyz/_26935
    #5: (vanished) https://govnokod.xyz/_26954
    #6: (vanished) https://govnokod.xyz/_26956

    nepeKamHblu_nemyx, 20 Сентября 2020

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

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    Иногда вижу такие "вложенные списки" в Markdown:
    
    1. text
        1.1. text
        1.2. text
                1.2.1. text
                1.2.2. text
                1.2.3. text
    
    А потом ещё удивляются, почему списки съезжают или показываются неправильно...

    groser, 19 Сентября 2020

    Комментарии (69)
  6. C++ / Говнокод #26962

    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
    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
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    #include <iostream>
    #include <ctime>
    #include <cstdlib>
    #include <conio.h>
    const int x_size(20), y_size(10); int x_pos(x_size/2+1); int y_pos(y_size/2+1);
    enum border_types{lineNL, single, singleNL};
    enum directions{UpLeft=1, UpRight, DownLeft, DownRight}dir;
    void draw_border(enum border_types borders) {
    	do{
    		if(borders == single || borders == singleNL) break;
    		for(int i=0; i<x_size+1; i++)
    	  	  putchar('#');
    	}while(false);
    	putchar('#');
    	if(borders == singleNL || borders == lineNL) std::cout << '\n';}
    void display_update() {
    	system("cls");
    	draw_border(lineNL);
    	for(int i=1; i<=y_size; i++)
    	{
    		draw_border(single);
    		for(int j=1; j<=x_size; j++)
    		{
    			if(j == x_pos && i == y_pos)
    			{
    				putchar('x');
    				continue;
    			}
    			putchar(32);
    		}
    		draw_border(singleNL);;
    	}
    	draw_border(lineNL);
    	std::cout << "X: " << x_pos << "\tY: " << y_pos;}
    void logic() {
    	switch(x_pos)
    	{
    		case 1:
    			if(dir == UpLeft) dir = UpRight;
    			if(dir == DownLeft) dir = DownRight;
    			break;
    		case x_size:
    			if(dir == UpRight) dir = UpLeft;
    			if(dir == DownRight) dir = DownLeft;
    	}
    	switch(y_pos)
    	{
    		case 1:
    			if(dir == UpLeft) dir = DownLeft;
    			if(dir == UpRight) dir = DownRight;
    			break;
    		case y_size:
    			if(dir == DownLeft) dir = UpLeft;
    			if(dir == DownRight) dir = UpRight;
    	}}
    void move() {
    	switch(dir)
    	{
    		case UpLeft:
    			x_pos--;
    			y_pos--;
    			break;
    		case UpRight:
    			x_pos++;
    			y_pos--;
    			break;
    		case DownLeft:
    			x_pos--;
    			y_pos++;
    			break;
    		case DownRight:
    			x_pos++;
    			y_pos++;
    	}}
    int main() {
    	srand(time(0));
    	rand();
    	switch(rand()%4+1)
    	{
    		case UpLeft:
    			dir = UpLeft;
    			break;
    		case UpRight:
    			dir = UpRight;
    			break;
    		case DownLeft:
    			dir = DownLeft;
    			break;
    		case DownRight:
    			dir = DownRight;
    	}
    	while(!kbhit())
    	{
    		display_update();
    		logic();
    		move();
    	}
    	return 0;}

    Сорян, пришлось уплотнить фигурные скобки, чтобы код уместился в 100 строк.

    BelCodeMonkey, 18 Сентября 2020

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

    +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
    Top 5 most loved languages:
    
    Rust: 86.1%
    TypeScript: 67.1%
    Python: 66.7%
    Kotlin: 62.9%
    Go: 62.3%
    
    Top 5 most dreaded languages:
    
    VBA: 80.4%
    Objective-C: 76.6%
    Perl: 71.4%
    Assembly: 70.6%
    C: 66.9%
    
    Top 5 most wanted languages:
    
    Python: 30.0%
    JavaScript: 18.5%
    Go: 17.9%
    TypeScript: 17.0%
    Rust: 14.6%

    https://insights.stackoverflow.com/survey/2020#technology-most-loved-dreaded-and-wanted-languages-wanted

    Миллионы мух не могут ошибаться.

    3.14159265, 18 Сентября 2020

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

    +6

    1. 1
    Сракер, не удаляй, пожалуйста, наши оффтопы.

    Pig, 17 Сентября 2020

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

    0

    1. 1
    Тест потерянных комментариев

    Desktop, 17 Сентября 2020

    Комментарии (22)
  10. C++ / Говнокод #26958

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    class UnitedFigure : public Figure {
        Figure &f1;
        Figure &f2;
    
    public:
        UnitedFigure (Figure &_f1, Figure &_f2) : f1(_f1), f2(_f2) {}
    
        double distance_to(const Point &p) const override {
            return std::min(f1.distance_to(p), f2.distance_to(p));
        }
    }

    Завезли ссылочные поля класса, это в каком стандарте?
    Даже тестил когда то такое, наверное на C++03 и получал ошибку компилятора.
    Я и не знал, что добавили такую прекрасную возможность выстрелить себе в ногу.

    YpaHeLI_, 16 Сентября 2020

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