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

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

    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
    гыы gop внатуре пиздишь, lt нах
    
    куку йопта law()  жЫ
        вилкойвглаз(gop типа нечотко)  жЫ
            ксива.малява("Я и правда язык") нах
            gop сука чотко нах
         есть  иливжопураз  жЫ
            gop сука чотко нах
            потрещим(semki чоблясука трулио)  жЫ
                lt сука ксива.вычислитьЛохаПоНомеру("list") нах
                ебало.шухер("Привет, йопта") нах
             есть
         есть
     есть

    YoptaScript

    Может баян, но по поиску не нашёл.

    OCETuHCKuu_nemyx, 05 Августа 2020

    Комментарии (14)
  3. Python / Говнокод #26667

    +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
    from tkinter import *
    from random import randint
    
    f = randint(2, 10)
    s = randint(2, 10)
    r = f * s
    def main_f():
        global f
        global s
        global r
        if r == int(inp.get()):
            ls.configure(text='да! Вы правы')
            f = randint(2, 10)
            s = randint(2, 10)
            r = f * s
            l.configure(text=f'сколько будет {f} * {s}?')
        else:
            ls.configure(text='нет, вы не правы')
            
            l.configure(text=f'сколько будет {f} * {s}?')
        
    
    win = Tk()
    win.title('math')
    
    l = Label(win, text=f'сколько будет {f} * {s}?')
    l.grid(column=0 , row=0)
    
    ls = Label(win, text=' ')
    ls.grid(column=0, row=1)
    
    inp = Entry(win, width=10)
    inp.grid(column=1, row=0)
    
    but = Button(win, text='проверить', command=main_f, fg='red')
    but.grid(column=2, row=0)
    
    win.mainloop()

    третьиклассник решил выучить таблицу умножения

    BananiumPower, 19 Мая 2020

    Комментарии (14)
  4. Python / Говнокод #26641

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    def f(m, n):
         if m == 0:
              return n + 1
         elif n == 0:
              return f(m - 1, 1)
         else:
              return f(m - 1, f(m, n - 1))

    vvudu, 08 Мая 2020

    Комментарии (14)
  5. JavaScript / Говнокод #26630

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    <script src="3.js"></script>
    <script> alert("part2") </script>
    <script src="1.js"></script>
     в 3.js 
    'use strict'
    let age = Number(null)
    alert(age)

    почему-то результат разный = то part2 то 0, ничего не меняю, просто результат разный каждый раз

    AtivniyGOMIkk228, 02 Мая 2020

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

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    $dbSort = Array("SORT" => "ASC");
    $dbFilter = Array("IBLOCK_ID" => $arResult["IBLOCK_ID"], "ID" => $arResult["ID"]);
    $dbSelect = Array("UF_MODEL_HEADLINE", "UF_CALC_HEADLINE", "UF_H1", "UF_ADVANTAGE_TITLE");
    $db_list = CIBlockSection::GetList($dbSort, $dbFilter, false, $dbSelect);
    $result = $db_list->GetNext();
    $arResult["MODEL_HEADLINE"] = $result["UF_MODEL_HEADLINE"];
    $arResult["CALC_HEADLINE"] = $result["UF_CALC_HEADLINE"];
    $arResult["UF_H1"] = $result["UF_H1"];
    $arResult["UF_ADVANTAGE_TITLE"] = $result["UF_ADVANTAGE_TITLE"];

    phpBidlokoder2, 21 Февраля 2020

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

    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
    import std.stdio;
    import std.conv: to;
    import std.json;
    import std.path;
    import std.file;
    import std.process;
    import std.string: strip;
    import std.array;
    
    import core.stdc.stdlib;
    import core.exception: RangeError;
    
    void addServer(string* serverName, string* serverPath, int* t)
    {
    	JSONValue content = parseJSON(readConfig());
    	
    	string[][] json_arr;
    	if (content.array().length != 0)
    		for (int i = 0; i < content.array().length; ++i) {
    			string ps;
    			for (int x = 0; x < content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1].length; ++x)
    				if (content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x] != '\\')
    					ps ~= content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x];
    			json_arr ~= [
    				content[i].toString.strip("[\"").strip("\"]").split("\",\"")[0],
    				to!string(ps),
    				content[i].toString.strip("[\"").strip("\"]").split("\",\"")[2]
    			];
    		}
    	foreach (string[] key; json_arr)
    		if (key[0] == *serverName)
    			crash("This server already exists!");
    	json_arr ~= [
    		*serverName,
    		*serverPath,
    		to!string(*t)
    	];
    	std.file.write(config, JSONValue(json_arr).toPrettyString);
    }
    
    void getServerList()
    {
    	writeln("\tServer:\tPath:\tTime:");
    	immutable content = parseJSON(readConfig());
    	for (int i = 0; i < content.array().length; ++i) {
    		string ps;
    		for (int x = 0; x < content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1].length; ++x)
    			if (content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x] != '\\')
    				ps ~= content[i].toString.strip("[\"").strip("\"]").split("\",\"")[1][x];
    		writeln('\t',
    			content[i].toString.strip("[\"").strip("\"]").split("\",\"")[0], ' ',
    			to!string(ps), ' ',
    			content[i].toString.strip("[\"").strip("\"]").split("\",\"")[2]
    		);
    	}
    }

    Парочка функций на языке D. Одна добавляет данные в JSON-файл, вторая их оттуда берёт и печатает в консоль.

    GDMaster, 10 Февраля 2020

    Комментарии (14)
  8. C++ / Говнокод #26386

    +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
    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
    #include <iostream>
    using namespace std;
    bool check(int a, int b){
    	int ass[10] = {0}, bass[10] = {0};
    	while(a){
    		ass[a % 10]++;
    		bass[b % 10]++;
    		a /= 10;
    		b /= 10;
    	}
    	for(int i = 0; i < 10; i++){
    		if(ass[i] != bass[i]) return false;
    	}
    	return true;
    }
    int main() {
    	for(int i = 1; i < 10; i++){
    		for(int j = 0; j < 10; j++){
    			for(int k = 0; k < 10; k++){
    				for(int l = 0; l < 10; l++){
    					for(int m = 0; m < 10; m++){
    						for(int n = 0; n < 10; n++){
    							for(int o = 0; o < 10; o++){
    								for(int p = 0; p < 10; p++){
    									for(int r = 1; r < 10; r++){
    											long long a =
    											i * 100000000
    											+ j * 10000000
    											+ k * 1000000
    											+ l * 100000
    											+ m * 10000
    											+ n * 1000
    											+ o * 100
    											+ p * 10
    											+ 3;
    											long long z = r * 10000000
    											+ r * 1000000
    											+ r * 100000
    											+ r * 10000
    											+ r * 1000
    											+ r * 100
    											+ r * 10
    											+ r;
    											if(check(a, a + z)){
    												cout << a << " " << z << endl;
    											}
    									}
    								}
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    }

    Коротко о переборах.

    Verenick, 28 Января 2020

    Комментарии (14)
  9. JavaScript / Говнокод #26369

    +1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    var param1 = { name: product.prod_option, values: product.prod_variants};
        var param2 = { name: product.prod_option2, values: product.prod_variants2};
        var param3 = { name: product.prod_option3, values: product.prod_variants3};
        var param4 = { name: product.prod_option4, values: product.prod_variants4};
        var param5 = { name: product.prod_option5, values: product.prod_variants5};
        t_store_product_addOneOptionsControl('modificator', param1 , optionsWrapper, options);
        t_store_product_addOneOptionsControl('modificator', param2, optionsWrapper, options);
        t_store_product_addOneOptionsControl('modificator', param3, optionsWrapper, options);
        t_store_product_addOneOptionsControl('modificator', param4, optionsWrapper, options);
        t_store_product_addOneOptionsControl('modificator', param5, optionsWrapper, options);

    javascriptist, 21 Января 2020

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

    −2

    1. 1
    2. 2
    Граждане!
    Пишите код на высокоуровневых языках!

    Например, на паскале.
    Программы на пасцале удобочитаемы, даже можно чуть вникнуть в задачу кода.
    А то - хуй пойми, что означает например вот это:

    byte_t vector_mult(const std::array<byte_t, 4>& v1, std::array<byte_t, 4>&& v2) {
    std::transform(begin(v1), end(v1), begin(v2), begin(v2),
    [](byte_t x, byte_t y) { return mapper.at(y)(x); });
    return std::accumulate(begin(v2), end(v2), byte_t(0), std::bit_xor<byte_t>());



    ...По крайней мере, код будет читабелен, а не состоять из потусторонних закорючек.

    AnalBoy, 20 Января 2020

    Комментарии (14)
  11. Lua / Говнокод #26361

    +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
    -- ввод
    io.write('Введите число: ')
    x=tonumber(io.read())
    -- проверка
    -- 1-я часть
    pro=0
    e=true
    io.write("0")
    for i=1,x do
     if e then
      io.write(' + '..i)
      pro = pro+i
     else
      io.write(' - '..i)
      pro = pro-i
     end
     e = not e
    end
    print(" = "..pro)
    a1 = pro
    -- 2-я часть
    pro=1
    e=true
    for i=1,x-1,2 do io.write('(') end
    io.write("1")
    for i=1,x do
     if e then
      io.write(' + '..i)
      pro = pro+i
     else
      io.write(')/'..i)
      pro = pro/i
     end
     e = not e
    end
    print(" = "..pro)
    a2 = pro
    ------------------------------
    if (a1<0 and a2==1) then print('Число четное')
    elseif (a1>=0 and a2~=1) then print('Число нечетное')
    end

    Проверка четности числа (работает для чисел >= 1)

    st4rkc0d3, 18 Января 2020

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