This Program Will Make You Mad

I sincerely apologize for writing such dissapointing and readable code.

Therefore, I have made it my goal to make the worst possible code, three times the amount of its current irritation level. I apologize for any inconvenience.

// program goal: print hello world in the console.
("hеllo world" == ((((("hello world")))))) ? console.log("hello world") : "hi"
// ^
// this is what it does.
const сonst = "e";//​:P​​​​​​​​​​​​​​​​​​​​​​​
(function(parameter){     ;                  ;;                                             ;;
var fаlse = true;function prinHelloWorld() {console.log((((((((((((((("hello world")))))))))))))));;;;;
};;;;;;;;;;;;;//////;//;const enCRYPTStRRRinG = (strrring) =>{return btoa(strrring);;;;;
const enCRYPTStRRRinG = (strrring) =>{return btoa(strrring);;;;;};;;;;;;;;;;;;;;; ;; ; ; ; ; ; ;;  ;;;;;;;;;;;;           ;const deCRYPT_STRRRING = (strring) =>                   {return atob(strring);;;;};;;;;;;;;;;;
                                                                                                                                               while (fаlse && true) {
  let h = enCRYPTStRRRinG("e").toString(), e=      new String(enCRYPTStRRRinG("d")), lеt  ="l", ඞ="      w ".trim(), w=enCRYPTStRRRinG("o "), r =  "r";var d = String.fromCharCode(104)
       var vаr = ``;//​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​
var ඞඞඞ = `"w"`.replaceAll(`"`, "");
                                               // hi
                                 if (true ==((((((fаlse)))))) && fаlse === fаlse || false) {
    vаr += d;;;vаr+=deCRYPT_STRRRING(h);vаr+=lеt.repeat(Number("9"+String.fromCharCode(48)));;;vаr +=           `          ${w}`+`${ඞඞඞ+w+r+lеt.repeat(90* (1+1+1+1+1+1+1+1+1+1+1+1    + 1- 11*1-1)/2)+e}`;;;;;; ;; ;;;; ;;         ;;       ;;;; ;;;;// ohhhhhhhhh we're halfway there ohhhhhh living on a prayer
                              ;;};;;;  ;;;;fаlse = Boolean(false)//
};;;;;;;vаr = vаr.replaceAll("l".repeat((90*3/3*7-90)/2/3/2+2-(Math.sqrt(4))), "l").replaceAll(d, "h").replaceAll("          "+enCRYPTStRRRinG("o "),       "o").replaceAll(
                       "w",            "".toString()+" "+ඞඞඞ         //ඞඞඞ is sinhala. not everything is among us, you know?
).replaceAll(enCRYPTStRRRinG("d"), deCRYPT_STRRRING(enCRYPTStRRRinG("d"))).replaceAll(enCRYPTStRRRinG("o "), "o");;;;;;;;;;;let usefulvаrIABLe = 27; //ooh no doze trez quad row sink-o says
                             let log = vаr;21
if(log === vаr && (vаr !== fаlse || true > fаlse)) {console.log(((((((
                                               vаr.concat(log).slice(0, (vаr+log).length/2)
)))))));; ;;;;;;;;;;;;;                               ;;;;;;;;;;;;//
;; ////////////// de clare variable
;;;             (["soutehrn nights have you ever felt the southern night"]);;;} else { prinHelloWorld(); }})(undefined);;;//​​;;;;

You’re welcome.

(P.S. this code does run, if there’s an error, tell me :pleading_face:)

1 Like

Yeah, that was the problem I found when starting in an earlier post. I decided that I wouldn’t overwrite it :smiley:

Thankfully, it worked.

UHHHHHHHHHHHHHHHH
JUST DO THIS:

console.log("Hello World!")

no, thank you good sir, but i must decline

1 Like

Wow, I’m honestly surprised this runs without any errors whatsoever. Why does var false = true work all of a sudden? :laughing:

4 Likes

i just changed the variable name :slight_smile:

var fаlse = true;
...
var vаr = ``;

I’ve done this before; try looking at this python import, this x.com link, or my first attempt at this.

5 Likes

You all thought those were bad? We were just getting warmed up! Now it’s time to see what scratch(lol) can do:


STAGE 2 WAS STARTED. THE THE GREAT BAD CODE WAR HAS STARTED Bedrockminer from the future: what have I just submitted to Replit ask

1 Like

And this is why I don’t recommend scratch :laughing:

2 Likes

So basically I made it so that you can run javascript in python.

exec("import js2py\nimport os");f=open(os.path.abspath(__file__),"r");t=f.read();js2py.eval_js(t[t.find("quit""()")+6:].replace("\"\"\"",""));f.close();quit()

"""
const data = [
    { a: .5, b: -35.5, c: -36, v: 0 },
    { a: -2, b: 203, c: -101, v: 1 },
    { a: -1.5, b: 163, c: -108, v: 1 },
    { a: 1.75, b: -186, c: -324, v: 0 },
    { a: 2, b: -226, c: 444, v: 0 },
    { a: 3, b: -100, c: 128, v: 0 },
    { a: -3, b: 260, c: 87, v: 1 },
    { a: 2.5, b: -275, c: -277.5, v: 0 },
    { a: -2.5, b: 287, c: -228, v: 1 },
    { a: 1, b: -103, c: -540, v: 0 },
    { a: -1, b: 103, c: -300, v: 1 },
    { a: 5, b: -147, c: -594, v: 0 },
];

const fromCharCode = String;
String.String = fromCharCode.fromCharCode;

function quadratic_formula(a, b, c) {
    let pos = (-b + Math.sqrt(b * b - (4 * a * c))) / (2 * a);
    let neg = (-b - Math.sqrt(b * b - (4 * a * c))) / (2 * a);

    return [pos, neg];
}

function use_values(values) {
    return Math.round(quadratic_formula(values.a, values.b, values.c)[values.v]);
}

let result = "";

data.forEach(function (vals) {
    result += fromCharCode.String(use_values(vals));
});

console.log(result);
"""

What you need to do is add this line to the top of your python file:
exec("import js2py\nimport os");f=open(os.path.abspath(__file__),"r");t=f.read();js2py.eval_js(t[t.find("quit""()")+6:].replace("\"\"\"",""));f.close();quit()
Then you simple put any javascript code inside of tripple quotes like this:

"""
console.log("javascript");
"""
4 Likes

use more of this character: ඞ

1 Like

Bruh lol gotta keep the old roasts alive.

1 Like

Omg the indent
It’s fine I can tolerate this kind of code
But I can’t tolerate codes that just try to be realistic and the code got many exploit and made it way far from its goal

I used to see a code somewhere in replit ask, it’s an life sim or stuff, and I got a little bit wild on helping him which end up writing an entire essay on the bugs in his code and why so, I thought I could write an entire book on how to improve his code, which thank god I didn’t (lol)

If any of you wonder, his code include a part where you earn salary, First his code is extremely nested and wild, second he literally misunderstand the reply on his post before mine which he made player stuck in a loop of paying taxes without getting paid (Fr if this in in real world and allowed, this world is messed up) which before the change it is completely fine. Third he wrote the entire sim inside a function called ‘game()’ and never called it

Yes I went furious on that lol, you can make people crazy by crazily nest your code :slight_smile:

1 Like

Also, as long as there are no syntax errors from python, you can put the javascript outside the quotes as plain text.

exec("import js2py\nimport os");f=open(os.path.abspath(__file__),"r");t=f.read();js2py.eval_js(t[t.find("quit""()")+6:].replace("\"\"\"",""));f.close();quit()

console.log("JAVASCRIPT!!!");
2 Likes
print ("this will never run lol")

by printing that it runs

1 Like

No, because the while loop is never broken.

1 Like
complicated_print = (
    lambda b, __print: (
        lambda f: (
            lambda x: x(x)
        )(
            lambda y: f(lambda *args: y(y)(*args))
        )
    )(
        lambda f: __print(
            ''.join(
                map(
                    b['chr'], [72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33]
                )
            ) + ' 2+2=' + b['str'](b['sum']([2, 2]))
        )
    )
)(
    {
        'sum': sum,
        'chr': chr,
        'str': str,
        'map': map,
        'print': print
    },
    print
)

I made this lmao, all it does is print Hello, World! 2+2=4.

4 Likes

Valid python code (trust me, copy into interpreter):

class ہ :1

if(1**1%1>>1//1&1^1|1or~1<<1+1and(1)._@1>1()<1>=1<=1[1::not-1]is{**1}!=1in[*1])==1:1

+~-+~-++++~-~-~---~1

I have a compilation of a ton of weird python features, put into a single file in a repl if anyone is interested.

2 Likes

The code is syntactically valid in the sense that the interpreter accepts it without immediately throwing a SyntaxError, but it will not run as-is. It’s only being treated as potentially valid Python code. However, the interpreter will encounter confusion regarding the intentions of the code. Warnings will occur about int objects not being callable or subscriptable, etc.

5 Likes

This is some valid, albeit weird python code:

from sys import stdout as rvhriosd

def reinov(oiernvf):
 ethdfb = []
 for usruwbhfoehwgfwh in oiernvf:
   if usruwbhfoehwgfwh in [chr(72),chr(101),chr(108),chr(111),chr(32),chr(119),chr(114),chr(100),chr(33),chr(13),chr(10)]:
      ethdfb.extend([ord(usruwbhfoehwgfwh)])
   else:
          ethdfb.extend([177])
 return ethdfb

def jdgfcjl(rpsofkd):
 for seufihdio in rpsofkd:
        if seufihdio == ord(chr(72)):
                   rvhriosd.write(chr(72))
        if seufihdio == ord(chr(101)):
                rvhriosd.write(chr(101))
        if seufihdio == ord(chr(108)):
               rvhriosd.write(chr(108))
        if seufihdio == ord(chr(111)):
                      rvhriosd.write(chr(111))
        if seufihdio == ord(chr(32)):
         rvhriosd.write(chr(32))
        if seufihdio == ord(chr(119)):
            rvhriosd.write(chr(119))
        if seufihdio == ord(chr(114)):
                  rvhriosd.write(chr(114))
        if seufihdio == ord(chr(100)):
          rvhriosd.write(chr(100))
        if seufihdio == ord(chr(33)):
                             rvhriosd.write(chr(33))
        if seufihdio == ord(chr(13)):
                                     rvhriosd.write(chr(13))
        if seufihdio == ord(chr(10)):
            rvhriosd.write(chr(10))

wusvd = reinov([chr(72),chr(101),chr(108),chr(108),chr(111),chr(32),chr(119),chr(111),chr(114),chr(108),chr(100),chr(33),chr(13),chr(10)])
jdgfcjl(wusvd)
4 Likes

Not sure what you mean, the SyntaxWarnings are just warnings and all of the code still runs. The interpreter is just giving warnings that what the programmer is doing is probably unintended.

2 Likes