Strict encounter
About this model
This diagram represents a structured simulation of the classic game "Rock-Paper-Scissors" with a mechanism for two players to compete and determine outcomes based on their choices. At its core, the diagram utilizes source nodes to initiate the game flow, simulating the choices of "Rock," "Paper," or "Scissors" for each player through gate nodes that distribute resources (representative of the players' choices) to pools designated for each choice. The system employs randomness through dice distribution modes at gate nodes to simulate the unpredictability of players' choices in an actual game. An interactive gate labeled "Play" triggers the simulation, allowing resources to flow according to the predefined rules where "Rock" beats "Scissors," "Scissors" beat "Paper," and "Paper" beats "Rock."
Further intricacy is added with a register node, which calculates the outcome of the game based on the comparison of players' choices. This is achieved through a formula that considers all possible outcomes to assign victory to Player 1, Player 2, or disallow a win based on the game's traditional rules. The result of each game can be observed in designated pools for "Player 1 wins" or "Player 2 wins," showcasing the simulation's ability to emulate the competitive nature and strict outcome possibilities of Rock-Paper-Scissors. A drain node labeled "Reset" serves as an option to clear the current state and prepare the diagram for a new round, emphasizing the game's iterative nature. The diagram not only facilitates a virtual Rock-Paper-Scissors match but also visually demonstrates the game's deterministic yet chance-driven mechanics.
"Strict encounter" is a public Machinations diagram shared in the Community by Cezar Cocias, with 39 components.
It was created in June 2023 and last edited in October 2023.
Open the diagram in the Machinations app and press Play to watch the resources move, adjust its values to test how the system responds, or remix it to make an editable copy in My diagrams.