0

I am working on a multiplayer blackjack implementation with an array of 52 cards as the deck that have a flag if they're selected or not. I'm implementing a random number generator to choose a random index of the deck array and then switch its flag as "picked." this simulates shuffling fine.

My problem arises when choosing the dealers second card as it's supposed to be 'face down' and unknown to the current players and essentially anyone checking the blockchain until all the players are finished.

What's the best approach to keep this selected index "private" but also marked so that future player card deals don't select the card?

  • Unfortunately it is hard to generate random numbers in solidity ethereum.stackexchange.com/questions/191/…. If you are OK with not so random numbers one option is to make the second dealer card with the input from all participants. – Ismael Nov 8 '19 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.