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

    Всего: 3

  2. JavaScript / Говнокод #27928

    −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
    const files = {
      "main.pcg": "funcTion text print hello;startFunction text;"
    };
    const functions = {};
    const values = {};
    function startc(text) {
      var code = text.trim();
      let strings = code.split(";");
      for(var i = 0; i < strings.length; i++) {
        let currentString = strings[i];
        let words = currentString.split(" ");
        if(words[0].toLowerCase() == "print") {
          console.log(words[1]);
        };
        if(words[0].toLowerCase() == "printValue") {
          console.log(values[words[1]]);
        };
        if(words[0].toLowerCase() == "value") {
          values[words[1]] = words[2];
        };
        if(words[0].toLowerCase() == "ws") {
          values[words[1]] = new WebSocket(words[2]);
        };
        if(words[0].toLowerCase() == "printcycle") {
          for(var i = 0; i < words[1]; i++) {
            console.log(words[2]);
          };
        };
        if(words[0].toLowerCase() == "function") {
          functions[words[1]] = words[2] + " " + words[3];
        };
        if(words[0].toLowerCase() == "startfunction") {
          startc(functions[words[1]]);
        };
      };
    };
    function start(file) {
      startc(files[file]);
    };

    govnokoder666, 06 Января 2022

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

    −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
    window.spam = (function () {
      function spam (els) {
             
        }
         
        var spam = {
            get: function (selector) {
             
            }   
        };
         
        return spam;
    }());

    govnokodishe!

    govnokoder666, 03 Января 2022

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

    −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
    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
    let SPAM = {
      "lastWsMessage": null,
      "lastWsLink": null,
      "specialFunctionWS": (urlws) => {
        SPAM.lastWsLink = urlws;
        let ws = new WebSocket(urlws);
        ws.onopen = () => {
          console.log("connected");
          return "connected";
        };
        ws.onclose = () => {
          console.log("disconnected");
          return "disconnected";
        };
        ws.onerror = () => {
          console.log("error");
          return "error";
        };
        ws.onmessage = (event) => {
          console.log("message ${event.data}");
          SPAM.lastWsMessage = event.data;
        };
      },
      "spammer": (text, amount) => {
        for(let a = 0; a < amount; a++) {
          console.log(text);
        };
        return amount;
      },
      "wsConnecting": (url) => {
        let splitter = url.split(":");
        if(splitter[0] == "ws") {
          console.log("WARNING: it is not advised to use the value \"ws\"!");
          SPAM.specialFunctionWS(url);
        };
        if(splitter[0] == "wss") {
          SPAM.specialFunctionWS(url);
        };
        if(splitter[0] == "http" || splitter[0] == "https") {
          console.log("WARNING: don't use the values http/https for socket connecting!\nLink changed: wss://" + url);
          SPAM.specialFunctionWS("wss://" + url);
        };
        if(splitter.length == 1) {
          console.log("WARNING: script is using the value \"wss\"!");
          SPAM.specialFunctionWS("wss://" + url);
        };
      },
      "SendWs": (message) => {
        if(SPAM.lastWsLink != null) {
          let ws = new WebSocket(SPAM.lastWsLink);
        ws.onopen = () => {
          console.log("connected");
          return "connected";
        };
        ws.onclose = () => {
          console.log("disconnected");
          return "disconnected";
        };
        ws.onerror = () => {
          console.log("error");
          return "error";
        };
        ws.onmessage = (event) => {
          console.log("message ${event.data}");
          SPAM.lastWsMessage = event.data;
        };
        } else {
          console.log("ERROR: last connection not found!");
        };
      }
    };

    govnokod!

    govnokoder666, 03 Января 2022

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