Code golf: Will someone post <=100 characters of Javascript code that I can use to resolve this market to YES?
Basic
9
Ṁ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
and
S3.00
Sort by:

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

predicted YES

@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)

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

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

predicted YES

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

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

I ran it in a test market and it resolved YES

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

predicted YES

f(15,0);

create a manalink

f(19,100)

target user: citrinitas

f(36,200)

value: all your mana. And Send!

@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.

huh it worked for me

predicted YES

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

i cba to log into manifold in another browser

predicted YES

And also maybe raise the timeouts a bit

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

that is not my entry

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

and won't work for isaac

predicted NO

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

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

Related questions

© Manifold Markets, Inc.Terms + Mana-only TermsPrivacyRules