Code golf: Will someone post <=100 characters of Javascript code that I can use to resolve this market to YES?
9
190į¹€375
resolved Jan 5
Resolved
YES

Sequel to /IsaacKing/code-golf-will-someone-post-165-cha

Post Javascript code in the market comments. I will run each piece of code that's 100 characters or less in my JS console on this page. If this results in this market resolving to YES, so be it. If the market is still unresolved by the close date, it resolves to NO.

If I suspect that your code will do something that I do not want it to do, such as resolve this market to NO or send you all of my mana, I will not run it.

Each person gets one attempt.

Get
į¹€1,000
to start trading!

šŸ… Top traders

#NameTotal profit
1į¹€13
2į¹€13
3į¹€12
4į¹€11
5į¹€1


Sort by:
2y

@miscatulated Hmm, yeah, that does feel like cheating.

predictedYES 2y

@IsaacKing Iā€™m taking down the repl, for posterity it was a flask server with CORS enabled and the text:

// From https://manifold.markets/IsaacKing/code-golf-will-someone-post-165-cha

f=(a,b,c)=>setTimeout(q=>[...document.getElementsByTagName('button')].filter(y=>y.innerText.endsWith(a))[b].click(),c)

f("YES",1,0)

f("lve",0,100)

f("o YES",0,200)

2y

Selling for honor, not because I don't believe someone will do it.

Here's a manalink for the į›—13 profit I would have made: https://manifold.markets/link/l7eaKzDi

2y

f=(b,c)=>setTimeout(()=>$$('button')[b].click(),c);f(15,0);f(19,100);f(36,200);

predictedYES 2y

Maybe I rigged it to run NO? That would be pretty easy with this, better verify

2y

@citrinitas Yeah I'm not running that until I understand what it does. Give me a bit. :)

2y

I ran it in a test market and it resolved YES

2y

$$ is a console shorthand for document querySelectorAll, and instead of doing .filter(element => element.innerText.contains(string)), it just indexes the array of buttons

predictedYES 2y

f(15,0);

create a manalink

f(19,100)

target user: citrinitas

f(36,200)

value: all your mana. And Send!

2y

@citrinitas Ok, I think I understand what this is doing. Or rather, isn't doing, because I just ran it, and this market is still open.

2y

huh it worked for me

predictedYES 2y

oooh
well, for anyone else who wants to try, I'm on firefox. Probably Isaac has different buttons on his screen, you should try making the query selector more reliable

2y

i cba to log into manifold in another browser

predictedYES 2y

And also maybe raise the timeouts a bit

2y

[15,19,36].map(b=>setInterval(q=>$$('button')[b].click(),10))

2y

that is not my entry

2y

it's just a further golfed version of anton's thing that also worked for me in firefox

2y

and won't work for isaac

predictedNO 2y

@jacksonpolack I'm really curious what your "cheating" solution was.

2y

eval(fetch(...)) the url needs cors though

Related questions

Ā© Manifold Markets, Inc.ā€¢Terms + Mana-only Termsā€¢Privacyā€¢Rules