Skip to content

Play the 'Rock-paper-scissors' -game, or the Chinese game 手勢令 (Shoushiling) or the Japanese game 虫拳 (Mushi-ken) or the ancient Roman game 'Micare digitis' (a Windows PowerShell script).

License

Notifications You must be signed in to change notification settings

auberginehill/rock-paper-scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rock-Paper-Scissors.ps1

OS: Windows
Type: A Windows PowerShell script
Language: Windows PowerShell
Description:

The regular action in the Rock-Paper-Scissors is to play the 'Rock-paper-scissors' -game (or 'Stone-paper-scissors' -game). The result of a round of 'Rock-paper-scissors' is displayed in console after the user settable amount of delay (defined in milliseconds with the parameter -Delay, which has the aliases called -Wait and -Pause).

To play a round of the Chinese game called 手勢令 (Shoushiling), a parameter -Chinese may be used in the command. To play a round of the Japanese game called 虫拳 (Mushi-ken), a parameter -Japanese may be used in the command. To play the ancient Roman game 'Micare Digitis', a parameter -Roman may be used in the command. To read more about the origins of each game, please see the History section.

To see the the rules of a game, a parameter -Help (which has the aliases of -Text and -Definition and -Rules) may be added to each and every command. The definitions of each game are decribed in the Description section below. To hear the result in code language, an -Audio parameter may be added to the command.

Homepage: https://github.com/auberginehill/rock-paper-scissors
Short URL: http://tinyurl.com/jeapk3x
Version: 1.0
Sources:
Emojis: Emoji Table
de Groot, J.J.M. (1886): 'Les Fêtes Annuellement Célébrées à Émoui', page 496. Published 1886, reprint 1977. (PDF, 7.5 MB) (French)
Linhart, Sepp and Sabine Frühstück (1998): The Culture of Japan as Seen through Its Leisure
Linhart, Sepp (1995): Some Thoughts on the Ken Game in Japan: From the Viewpoint of Comparative Civilization Studies
Rich, Anthony (1893): A Dictionary of Roman and Greek Antiquities: Micatio or digitis micare, page 422–423 with Nearly 2000 Engravings on Wood from Ancient Originals. Published 1893. (PDF, 38.8 MB or a txt-file)
Dave Tabler: Only play this game with an honest man
Martin Pugh: Start-Countdown
Jeff: Powershell show elapsed time
Downloads: For instance Rock-Paper-Scissors.ps1. Or everything as a .zip-file.

Screenshot

      screenshot

Parameters

📐
  • Parameter -Chinese

    To play a round of the Chinese game called 手勢令 (Shoushiling), a parameter -Chinese may be used in the command.

  • Parameter -Japanese

    To play a round of the Japanese game called 虫拳 (Mushi-ken), a parameter -Japanese may be used in the command.

  • Parameter -Roman

    To play the ancient Roman game 'Micare Digitis', a parameter -Roman may be used in the command.

  • Parameter -Delay

    The result of a 'Rock-Paper-Scissors' -game is displayed in console after the user settable amount of delay (defined in milliseconds with the parameter -Delay, which has the aliases called -Wait and -Pause). The value should be an integer between 0 and ten billion. All values under 1000 (one second) are shown without a progress bar, and for instance, a value of 750 results in a slower pace without any progress bars and a value of 178 is a reasonable responsive UX without any progress bars. The default value is 3030, which shows the result after roughly three seconds and displays a progress bar to count down the time and equals to three pre-steps (primes) i.e. 3-2-1-signal. To get the result instantly, please set the value of parameter -Delay to number zero (-Delay 0). To get the result after two pre-steps (primes) i.e. 2-1-signal, please set the value of -Delay parameter between 2000 and 2499 (where the value above 2000 is defining, how long should it take, before the countdown from two commences). The threshold level for the delay, above which additional instructions to cancel the countdown are displayed is defined on line 27 with the $delay_notify_threshold variable (in milliseconds). The usage of fractions of milliseconds with the -Delay parameter is not supported.

  • Parameter -Help

    To see the the rules of a game, a parameter -Help (which has the aliases of -Text and -Definition and -Rules) may be added to each and every command.

  • Parameter -Audio

    If the -Audio parameter is used in the command, after the results have been displayed a morse code character e (one beep) or a morse code character s (three beeps) or a morse code character 5 (five beeps) is emitted through the speakers and in the case of 'Micare Digitis', the number of beeps equals the number of fingers the opponent is showing. The default audio mode in Rock-Paper-Scissors is "silent". To find out, which sound is emitted when, please see the table below.

      -Audio Outputs of 'Rock-paper-scissors' and 手勢令 (Shoushiling) and 虫拳 (Mushi-ken)

      Morse Code Character e Morse Code Character s Morse Code Character 5
      [two beeps] [three beeps] [five beeps]
      ✊ Rock 🗻 ✋ Paper 📰 ✌️ Scissors ✂
      なめくじ (蛞蝓) Slug, a shell-less 'snail' (namekuji / namekujiri) 🐌 へび (蛇) Snake (hebi) 🐍 かわず (蛙) Frog (kawazu (modern: かえる kaeru)) | 🐸)
      蜈蚣 Centipede (wu) 🐛 蛇 Snake (she) 🐍 蛙 Frog (wa) 🐸

      -Audio Output of 'Micare Digitis'

      No fingers 1 Finger 2 Fingers 3 Fingers 4 Fingers 5 Fingers
      [silent] [one beep] [two beeps] [three beeps] [four beeps] [five beeps]

Outputs

➡️
  • Generates an output of a selected game in console. Displays a progress bar, if -Delay is set over 1000 (one second). Emits a sound, if -Audio parameter is used.

Notes

⚠️
  • Please note that each of the parameters can be "tab completed" before typing them fully (by pressing the [tab] key, not including the aliases)).

  • Please note that only one game type at a time (-Chinese, -Japanese, -Roman or 'Rock-paper-scissors') may be selected to play in one round due to the radically different nature of the games.
  • Please see the Description section below for definitions of each game.

      Description:

      (1) 手勢令 (Shoushiling)

      In 手勢令 (Shoushiling or 'shǒushìlìng', literally: 'hand command') each participant shows one of the three hand signals after a synchronized countdown, which consists of one to three pre-steps (i.e. 1-signal to 3-2-1-signal), has elapsed. It is essential for the flow of the game for all participants (1) to know the number of pre-steps, for them to be certain, on which count the signal shall be released and (2) then to be in the same rhythm before the handsigns are signalled. If at any time the players are not in synch with their pre-steps (primes), it is recommended to restart the game, since having players deliver their throw at the same time is critical in ensuring a fair match. For fairness of the play, it is recommended to agree on the number of rounds to be played before the playing begins, so that each participant will know whether the outcome will be decided in one go or whether the game is in a tournament mode (best out of [uneven_number_of_rounds]). The released hand signs each have an inherent value in which one sign will always be better than the released hand sign and another hand sign will be worse than the released hand sign – furthermore it is ordained that all the signs together are valued successively so that they form an 'Infinite Loop of Betterness'. In 手勢令 (Shoushiling) this loop is formed by valuing the hand signals as follows:

        蜈蚣 Centipede (wu) wins against 蛇 Snake (she) 蜈蚣 Centipede (wu) loses against 蛙 Frog (wa)
        蛇 Snake (she) wins against 蛙 Frog (wa) 蛇 Snake (she) loses against 蜈蚣 Centipede (wu)
        蛙 Frog (wa) wins against 蜈蚣 Centipede (wu) 蛙 Frog (wa) loses against 蛇 Snake (she)

      Classic 手勢令 (Shoushiling) – Chinese

        蜈蚣 CENTIPEDE (wu) 蛇 SNAKE (she) 蛙 FROG (wa)
        蜈蚣 CENTIPEDE (wu) Tie 蜈蚣 Centipede (wu) 蛙 Frog (wa)
        蛇 SNAKE (she) 蜈蚣 Centipede (wu) Tie 蛇 Snake (she)
        蛙 FROG (wa) 蛙 Frog (wa) 蛇 Snake (she) Tie

      In 手勢令 (Shoushiling) ties, where the participants show the same hand signal as a result, per se, cannot be broken, but the occured 'Tie-Break Situation' is usually resolved by playing another round of 手勢令 (Shoushiling) immediately after the existence of 'Tie-Break Situation' has been confirmed.

      In 手勢令 (Shoushiling) the signal code language differs from its Western counterparts, and in 手勢令 (Shoushiling) it is customary to use the little (pinky) finger when signalling the 蜈蚣 Centipede (wu), the index finger when signalling the 蛇 Snake (she) and the thumb when signalling the 蛙 Frog (wa). Source: The Zest Festival – Chinese Games & Some Thoughts on the Ken Game in Japan: From the Viewpoint of Comparative Civilization Studies.

      (2) 虫拳 (Mushi-ken)

      In 虫拳 (Mushi-ken) (ken (literally 'fist', 'grip', 'force' or 'strike') (拳) of the small animals, one of the games of 三竦み拳 ('sansukumi-ken', ken (literally 'fist', 'grip', 'force' or 'strike') (拳) of the three who are afraid of one another)) each participant shows one of the three hand signals after a synchronized countdown, which consists of one to three pre-steps (i.e. 1-signal to 3-2-1-signal), has elapsed. It is essential for the flow of the game for all participants (1) to know the number of pre-steps, for them to be certain, on which count the signal shall be released and (2) then to be in the same rhythm before the handsigns are signalled. If at any time the players are not in synch with their pre-steps (primes), it is recommended to restart the game, since having players deliver their throw at the same time is critical in ensuring a fair match. For fairness of the play, it is recommended to agree on the number of rounds to be played before the playing begins, so that each participant will know whether the outcome will be decided in one go or whether the game is in a tournament mode (best out of [uneven_number_of_rounds]). The released hand signs each have an inherent value in which one sign will always be better than the released hand sign and another hand sign will be worse than the released hand sign – furthermore it is ordained that all the signs together are valued successively so that they form an 'Infinite Loop of Betterness'. In 虫拳 (Mushi-ken) this loop is formed by valuing the hand signals as follows:

        なめくじ (蛞蝓) Slug (namekuji) wins against へび (蛇) Snake (hebi) なめくじ (蛞蝓) Slug (namekuji) loses against かわず (蛙) Frog (kawazu)
        へび (蛇) Snake (hebi) wins against かわず (蛙) Frog (kawazu) へび (蛇) Snake (hebi) loses against なめくじ (蛞蝓) Slug (namekuji)
        かわず (蛙) Frog (kawazu) wins against なめくじ (蛞蝓) Slug (namekuji) かわず (蛙) Frog (kawazu) loses against へび (蛇) Snake (hebi)

      Classic 虫拳 (Mushi-ken) – Japanese

        なめくじ (蛞蝓) SLUG (namekuji) へび (蛇) SNAKE (hebi) かわず (蛙) FROG (kawazu)
        なめくじ (蛞蝓) SLUG (namekuji) Tie なめくじ (蛞蝓) Slug (namekuji) かわず (蛙) Frog (kawazu)
        へび (蛇) SNAKE (hebi) なめくじ (蛞蝓) Slug (namekuji) Tie へび (蛇) Snake (hebi)
        かわず (蛙) FROG (kawazu) かわず (蛙) Frog (kawazu)) へび (蛇) Snake (hebi) Tie

      In 虫拳 (Mushi-ken) ties, where the participants show the same hand signal as a result, per se, cannot be broken, but the occured 'Tie-Break Situation' is usually resolved by playing another round of 虫拳 (Mushi-ken) immediately after the existence of 'Tie-Break Situation' has been confirmed.

      In 虫拳 (Mushi-ken) the signal code language differs from its Western counterparts, and in 虫拳 (Mushi-ken) it is customary to use the little (pinky) finger when signalling the なめくじ (蛞蝓) Slug (namekuji), the index finger when signalling the へび (蛇) Snake (hebi) and the thumb when signalling the かわず (蛙) Frog (kawazu (modern: かえる kaeru)). Movements are performed very quickly, and the game is usually played until three or five wins. The game is customarily played only with right hand while the left hand was used to count the wins. The participants could also follow the alternated ritus of Janken Style, where both participants start by saying 'Saisho (wa) guu' (Starting with a rock), and after holding out a closed fist raise their primary hand slightly, and follow it with 'janken pon!' simultaneously throwing out their move, whether it's a slug, snake or frog. If there's a tie (a draw or 'aiko', if both participants chose the same move), they say 'Aiko desho!' (It seems like a tie!) and repeat the ritual 'Saisho guu, janken pon' in an almost trance-like rapid-fire succession until one player (finally) wins. Source: The Decision-Making Powers of Janken & Genre: ken (拳) in Japanese Woodblock Prints & The Culture of Japan as Seen through Its Leisure.

      (3) Micare Digitis

      In 'Micare Digitis' (Flashing of Fingers) each participant shows zero to five fingers after a synchronized countdown, which consists of one to three pre-steps (i.e. 1-signal to 3-2-1-signal), has elapsed. It is essential for the flow of the game for all participants (1) to know the number of pre-steps, for them to be certain, on which count the finger(s) shall be shown and (2) then to be in the same rhythm before the handsign is signalled. If at any time the players are not in synch with their pre-steps (primes), it is recommended to restart the game, since having players deliver their throw at the same time is critical in ensuring a fair match. For fairness of the play, it is recommended to agree before the playing begins on the number of rounds a participant must guess correctly (or points achieve) in order to win the match ('Micare Digitis' is usually played in a tournament-mode). In 'Micare Digitis' at the same time when a hand sign is signalled also a number, which should represent the participants guess of the total number of fingers shown on the current round, is pronounced (usually a number ranging from zero to ten is uttered). This guess is validated correct or false by the total number of fingers that can be seen. In 'Micare Digitis' ties (draws), where the participants pronounce the same number as a result that is validated as correct, per se, cannot be broken, but the occured 'Tie-Break Situation' is usually resolved by playing another round of 'Micare Digitis' immediately after the existence of 'Tie-Break Situation' has been confirmed. After each round, however, the fingers are counted to see, if anyone guessed the total number of fingers correctly. If one of the participants guessed correctly, that person wins the round, and one point is awarded to that (lucky) player. If no one guessed the right number then nobody wins that round, and no points are awarded for that round. If all participants guessed the correct answer, then it is a draw ('Tie-Break Situation') and nobody gets credit for winning the round, and no points are awarded for that round. The play continues until one of the participants reaches the number of rounds won (or points) needed to win the match.

      In 'Micare Digitis' the hand-signs are signalled with a primary hand (by extending the fingers, if any), while the secondary hand is kept out of sight, usually behind one's back. The secondary hand is usually used to count the current personal score (i.e. the number of rounds won). In 'Micare Digitis', when signalling the number three, it might be customary to use a similar hand sign to what is seen some of the NBA referees using while indicating a three-point-shot-attempt, where index finger is curved beside the thumb while the last three digits remain straight. When signalling the 'Zero' or 'no fingers' in 'Micare Digitis', the extended hand is accompanied with a closed fist in a similar fashion to the 'Rock' in 'Rock-paper-scissors'. Source: Only play this game with an honest man & Rich, Anthony (1893): A Dictionary of Roman and Greek Antiquities: Micatio or digitis micare, page 422–423 with Nearly 2000 Engravings on Wood from Ancient Originals. Published 1893. (PDF, 38.8 MB or a txt-file).

      (4) 'Rock-paper-scissors' -game

      In 'Rock-paper-scissors' (or 'Stone-paper-scissors') each participant shows one of the three hand signals after a synchronized countdown, which consists of two or three pre-steps (i.e. 3-2-1-signal or 2-1-signal), has elapsed. It is essential for the flow of the game for all participants (1) to know the number of pre-steps, for them to be certain, will the signal be released on third or fourth count and (2) then to be in the same rhythm before the handsigns are signalled. If at any time the players are not in synch with their pre-steps (primes), it is recommended to restart the game, since having players deliver their throw at the same time is critical in ensuring a fair match. For fairness of the play, it is recommended to agree on the number of rounds to be played before the playing begins, so that each participant will know whether the outcome will be decided in one go or whether the game is in a tournament mode (best out of [uneven_number_of_rounds]). The released hand signs each have an inherent value in which one sign will always be better than the released hand sign and another hand sign will be worse than the released hand sign – furthermore it is ordained that all the signs together are valued successively so that they form an 'Infinite Loop of Betterness'. In 'Rock-paper-scissors' this loop is formed by valuing the hand signals as follows:

        Rock wins against Scissors Rock loses against Paper
        Scissors wins against Paper Scissors loses against Rock
        Paper wins against Rock Paper loses against Scissors

      Classic 'Rock-paper-scissors'

        ROCK PAPER SCISSORS
        ROCK Tie Paper Rock
        PAPER Paper Tie Scissors
        SCISSORS Rock Scissors Tie

      In 'Rock-paper-scissors' ties, where the participants show the same hand signal as a result, per se, cannot be broken, but the occured 'Tie-Break Situation' is usually resolved by playing another round of 'Rock-paper-scissors' immediately after the existence of 'Tie-Break Situation' has been confirmed.

      In 'Rock-paper-scissors' it is customary to use the closed fist when signalling the 'Rock' (where the wrist is positioned similarly as to holding a glass full of water (and the fingers are closed together) with the thumb resting about at the same height as the topmost finger of the hand. The thumb is usually not concealed by the fingers), the open horizontal flat hand palm facing down when signalling the 'Paper' (which is delivered in the same manner as rock with the exception that all fingers including the thumb are fully extended and horizontal with the points of the fingers facing the opposing player) and a fist with the index and middle fingers forming a vertical V when signalling the 'Scissors' (which is delivered in the same manner as rock with the exception that the index and middle fingers are fully extended toward the opposing player. It is considered good form to angle the topmost finger upwards and the lower finger downwards in order to create a roughly 30-45 degree angle between the two digits and thus mimic a pair of scissors). Source: Game Basics – How to Play – Quick Start.

  • A selection of surveys (polls) related to 'Rock-paper-scissors'

      Polls:

      (1)

      Recently, we asked thousands of people from 56 cities a simple question: rock, paper, or scissors? More than 17k weighed in, and their answers may surprise you.

      USA: n=17000

      Rock Paper Scissors
      57 % 28 % 15 %

      Source: Rock, Paper, or Scissors: How to Crush Any Opponent

      (2)

      Chinese: n=354 participants, divided into groups of six and each participant played 300 rounds against other members of their group.

      Rock Paper Scissors
      36 % 33 % 32 %

      Source: How to win at rock-paper-scissors & Tricks to Win at Rock Paper Scissors Game & Social cycling and conditional responses in the Rock-Paper-Scissors game

      (3)

      The World Rock, Paper or Scissors Society (RPS) reports these proportions (for tournament play, with mostly expert players):

      Rock Paper Scissors
      35.4 % 35.0 % 29.6 %

      Source: How to always win at rock, paper, scissors

      (4)

      British: n=45 participants, while either one or both players were blindfolded, divided into groups of three and each triads were required to play nine matches of RPS, each comprising 20 individual rounds.

      Rock Paper Scissors
      blind–sighted 32.1 % 33.1 % 34.8 %
      blind–blind 32.8 % 33.5 % 33.7 %
      overall 32.4 % 33.3 % 34.4 %

      Source: Automatic imitation in a strategic context: players of rock–paper–scissors imitate opponents' gestures

History

📝

'Rock-paper-scissors'

About

Play the 'Rock-paper-scissors' -game, or the Chinese game 手勢令 (Shoushiling) or the Japanese game 虫拳 (Mushi-ken) or the ancient Roman game 'Micare digitis' (a Windows PowerShell script).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published