Mechanism Multipeer Connectivity uses Bluetooth or other means of communication. Since there may be a delay in receiving communication messages, two possible scenarios are considered. To determine which button was pressed first in each scenario, the following communication process takes place:

  1. When one party presses the button significantly earlier than the other party (The terms “win” and “lose” refer to determining which party pressed the button first.) If we assume that the device that was pressed earlier is A, the following steps occur:

  2. A informs B of the time when the button was pressed.

  3. Since B has not yet pressed the button, B displays “lose” on the screen.

  4. However, at this point, the A device does not know if it won or not. Therefore, after displaying “lose,” B informs A that it has lost.

  5. When A receives this message, it realizes that it has won and displays “win” on the screen.

  6. When the timing between the two teams is very close If B presses the button before receiving A’s message, the following steps occur:

  7. When A presses the button, it sends the time when B pressed the button, just like before.

  8. Before B receives this message, B also presses the button and sends the time when B pressed the button to A.

  9. After that, A receives communication from B. B compares the time when it was pressed with the time when A pressed the button. As a result, B realizes that it has lost and displays “lose” on the screen.

  10. Similarly, when A receives communication from B, it compares the times and realizes that it has won, displaying “win” on the screen.