The game 'Matching Pennies' implemented in Rust
Matching Pennies1 is a simple game played between two players (referred to as “Even” and “Odd”). At the start of each round of the game, each player has a penny, and must secretly pick either heads or tails. The players’ choices are then revealed simultaneously.
If the choices match (i.e., both heads or both tails) then Even wins the round and keeps both pennies, and the score for the round is thus +1 to Even and -1 to Odd. If the choices differ (i.e., one player chooses heads and the other player chooses tails) then Odd wins the round and keeps both pennies, and the score for the round is thus -1 to Even and +1 to Odd.