1. Список говнокодов пользователя GDMaster

    Всего: 6

  2. Си / Говнокод #26993

    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
    #include <stdio.h>
    
    int main()
    {
        goto a;
        h: printf("W"); goto i;
        g: printf(" "); goto h;
        m: printf("!"); goto n;
        i: printf("o"); goto j;
        n: printf("\n"); goto end;
        b: printf("e"); goto c;
        e: printf("o"); goto f;
        j: printf("r"); goto k;
        d: printf("l"); goto e;
        f: printf(","); goto g;
        a: printf("H"); goto b;
        k: printf("l"); goto l;
        l: printf("d"); goto m;
        c: printf("l"); goto d;
        end: ;
        
        return 0;
    }

    GDMaster, 01 Октября 2020

    Комментарии (39)
  3. Си / Говнокод #26972

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    #include <stdlib.h>
    
    void main()
    {
        a: ; malloc(1); goto a;
    }

    GDMaster, 23 Сентября 2020

    Комментарии (17)
  4. Java / Говнокод #26970

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public void startLoginService(User paramUser) {
        if (paramUser != null) {
            Intent intent = new Intent((Context)this, LoginService.class);
            intent.putExtra("LOGIN_KEY", paramUser.getLogin());
            intent.putExtra("PASSWORD_KEY", String.valueOf(paramUser.getId()));
            startService(intent);
        }
    }

    GDMaster, 22 Сентября 2020

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

    −1

    1. 1
    // https://habr.com/ru/company/ruvds/blog/515676/

    Разбор худшего в мире куска кода.

    GDMaster, 02 Сентября 2020

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

    +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
    /// Checks if the token is number or not
    bool is_number(char* test_val)
    {
        const char* ROW = "0123456789\0";
        
        for (int i = 0; i < strlen(test_val); i++) {
            for (int j = 0; j < strlen(ROW); j++) {
                if (test_val[i] == ROW[j]) {
                    goto next;
                }
            }
            return false;
            next:
        }
        return true;
    }

    Попытка проверить строку на число в Си.

    GDMaster, 02 Сентября 2020

    Комментарии (70)
  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)