How, for example, might you implement a simple "coin-flip" game as an on-chain solanaSolana program?
The concept is that a player deposits a coin or token, and the smart contract generates a "win" or a "lose" with a 50/50 chance. On a win the game would payout the original coin and a winning amount and on a lose, the coin would be added to a pool.
This question was previously asked but the text of that question was edited significantly so that it now asks something entirely different. The Q+A was reposted here to keep them in sync.