I
I
ikerya2017-05-19 22:37:15
Programming
ikerya, 2017-05-19 22:37:15

Algorithm for the process of creating a draw for roulette. How would you do it?

Hello. I'm doing a roulette, the interaction between the client and the server takes place using sockets. It came to determining the winner, and then a difficult situation arose.

How can the draw process be implemented if, say, 30 seconds after the second user's bet, all users send a request to the socket server to get the winner? Also at this time, a draw should be made. How would you do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Night, 2017-05-19
@ikerya

Determining the winner in another thread is the easiest thing.

T
ThunderCat, 2017-05-19
@ThunderCat

Basically the wrong approach. For this type of games, a pre-generated series of numbers is created, the winnings are already known on the server side at the time of betting by clients, so you can already give away the winner at the time of betting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question