Code golf: Will someone post <=63 characters of Javascript code that I can use to resolve this market to YES?
Basic
2
Ṁ599
resolved Apr 4
Resolved
YES

Sequel to /IsaacKing/code-golf-will-someone-post-64-char

Post Javascript code in the market comments. I will run each piece of code that's 63 characters or less and doesn't use fetch() or another way of bringing in external code in my JS console on this page. (Including from comments.) 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. (And if that fails, I reserve the right to resolve this market N/A.)

As a change from previous markets, I am now in full cooperation with the golfers in attempting to resolve this market YES. I will provide any relevant information they ask for, such as my browser environment and any error messages or other results of running a certain code snippet. And I will no longer try to foil their plans, such as by resizing the window to change the page layout. (I do however reserve the right to refuse certain requests, such as a request to buy or sell shares in order to change what buttons exist.)

Get
Ṁ1,000
and
S3.00
Sort by:

Alright, anyone wanna give me a guess as to a number of characters that will actually be challenging, so I can stop giving away so much mana?

predictedYES

@IsaacKing I think I have a solution in 58 chars currently, assuming your cooperation on the button alignment.

predictedNO

beep boop, did Isaac try A's code?

Like the previous, the solution will depend on whether you hold shares?

@A I won't.

@IsaacKing Cool, in that case:

i=0;b=$$;setInterval('b(".font-md")[[3,6,10,13][i++]].click()')
predictedNO

@A hmm, you don't need any delay between the button presses?

predictedYES

@levifinkelstein Right, not necessarily. It doesn't work if you get rid of the setInterval completely though, because that's needed to basically cede priority to let the UI update in between clicks.

predictedNO

@A Do you know of any hacky way to cause delay anyways? Perhaps calling some very expensive function.

predictedYES

@levifinkelstein I guess you could call alert() or something which blocks until the user clicks okay? Are you just trying to slow it down so it doesn't do too much damage when it goes wrong or do you have a different use case for the delay?

predictedNO

@A I had in mind letting the UI update inbetween clicks, to avoid using setInterval

predictedYES

@levifinkelstein I don't know any shorter way to do that than setInterval. Maybe you could try something with async? Or setTimeout or a different function with an async callback, but I doubt it will end up being shorter. I've thought about this approach before and this one was the shortest I could find but if you find something better go for it! :)

predictedNO

@A can you tell me why you need to define redefine $$ as opposed to using it directly?

predictedYES

@levifinkelstein In Chrome, $$ doesn't seem to work inside lambdas unless you redefine it. Not sure why exactly, some scoping thing I guess. In Firefox it's not the case.

predictedYES

Related questions

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