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.)
@IsaacKing I think I have a solution in 58 chars currently, assuming your cooperation on the button alignment.
@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.
@A Do you know of any hacky way to cause delay anyways? Perhaps calling some very expensive function.
@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?
@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! :)
@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.
@IsaacKing Have you tested my previous code snippet yet? https://manifold.markets/IsaacKing/code-golf-will-someone-post-63-char#sO8SXki8YBxDQqIq7Lx1