Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintended solution for jabba? #18

Open
sleirsgoevy opened this issue Oct 6, 2024 · 0 comments
Open

Unintended solution for jabba? #18

sleirsgoevy opened this issue Oct 6, 2024 · 0 comments

Comments

@sleirsgoevy
Copy link

The solution is as follows:

  1. Make a guess
  2. Open two websockets, ws1 and ws2. On ws1 we claim the guess and check the result.
  3. If we won, we close ws2 then ws1. Otherwise we close ws1 then ws2.

This works because the websocket saves the balance inside itself on initialization, and commits it to the user's balance without checking for concurrent modifications. This way we can have two sockets open and choose which one (a guaranteed 0 or a random -1/1) we want to pick.

The "intended" solution is more complex, so I guess this one was not intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant