ShareShortcuts

Rock Paper Scissors

You know what it is…

beastbeats
Fork “Rock Paper Scissors”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so beastbeats gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
32K
Saved
1
Actions
90
Category
Fun
Version
1.0
Language
EN

You know what it is…

What's New

Version 1.0

First release

Version History
1.0 Jun 15, 2023

First release

What it does

90 actions
  1. Show Alert
    ❌ Rock Paper Scissors ❌
  2. Get File
  3. If
  4. Number
  5. Set Variable
    Derrotas
  6. Set Variable
    Victorias
  7. Set Variable
    Empates
  8. Dictionary
  9. Set Variable
    WLT
  10. Append to Text File
  11. Save File
  12. If
  13. Repeat
  14. Get File
  15. Get Dictionary from Input
  16. Get Dictionary Value
  17. Set Variable
    Victorias
  18. Get Dictionary Value
  19. Set Variable
    Derrotas
  20. Get Dictionary Value
  21. Set Variable
    Empates
  22. Choose from Menu
    Pick up one
  23. Choose from Menu
    Rock 🗿
  24. Random Number
  25. Set Variable
    Piedra
  26. If
  27. If
  28. Show Alert
    You won!
  29. Calculate
  30. Set Variable
    Victorias
  31. If
  32. Show Alert
    You lost!
  33. Calculate
  34. Set Variable
    Derrotas
  35. If
  36. Show Alert
    Tie!
  37. Calculate
  38. Set Variable
    Empates
  39. Choose from Menu
    Paper 📄
  40. Random Number
  41. If
  42. If
  43. Show Alert
    You lost!
  44. Calculate
  45. Set Variable
    Derrotas
  46. If
  47. Show Alert
    Tie!
  48. Calculate
  49. Set Variable
    Empates
  50. If
  51. Show Alert
    You won!
  52. Calculate
  53. Set Variable
    Victorias
  54. Choose from Menu
    Scissors ✂️
  55. Random Number
  56. If
  57. If
  58. Show Alert
    Tie!
  59. Calculate
  60. Set Variable
    Empates
  61. If
  62. Show Alert
    You won!
  63. Calculate
  64. Set Variable
    Victorias
  65. If
  66. Show Alert
    You lost!
  67. Calculate
  68. Set Variable
    Derrotas
  69. Choose from Menu
    - Stats -
  70. Calculate
  71. Round Number
  72. Set Variable
    WL
  73. Choose from Menu
  74. Choose from Menu
    Wins - Victorias
  75. Nothing
  76. Choose from Menu
    Losses - Derrotas
  77. Nothing
  78. Choose from Menu
    Ties - Empates
  79. Nothing
  80. Choose from Menu
    W / L ratio - WL
  81. Choose from Menu
    Reset Stats
  82. Choose from Menu
    Are you sure you want to reset your stats?
  83. Choose from Menu
    Yes
  84. Number
  85. Set Variable
    Victorias
  86. Set Variable
    Derrotas
  87. Set Variable
    Empates
  88. Choose from Menu
    No
  89. Dictionary
  90. Save File

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/math'
#include 'actions/documents'
#define color violet
#define glyph gameController

alert("By BeastBeasts", "❌ Rock Paper Scissors ❌")
const Archivo = getFileFromFolder(, "PPTstats.json", false)

if !Archivo {
	@Derrotas = 0
	@Victorias
	@Empates
	@WLT = {
		"Loses_Count": "{@Derrotas}",
		"Ties_Count": "{@Empates}",
		"Wins_Count": "{@Victorias}"
	}
	appendToFile("PPTstats.json", @WLT)
	saveFile("PPTstats.json", nil, true)
} else {
}

repeat _ for 111 {
	const Archivo1 = getFile("PPTstats.json", false)
	const Diccionario = getDictionary(Archivo1)
	@Victorias = Diccionario['Wins_Count']
	@Derrotas = Diccionario['Loses_Count']
	@Empates = Diccionario['Ties_Count']
	menu "Pick up one" {
	item "Rock 🗿":
		randomNumber(1, 3)
		@Piedra
		if @Piedra >= 2 {
			if @Piedra == 3 {
				alert("Rock - Scissors", "You won!")
				@Victorias = @Victorias + 1
			} else {
				alert("Rock - Paper", "You lost!")
				@Derrotas = @Derrotas + 1
			}
		} else {
			alert("Rock - Rock", "Tie!")
			@Empates = @Empates + 1
		}
	item "Paper 📄":
		const NmeroAleatorio = randomNumber(1, 3)
		if NmeroAleatorio >= 2 {
			if NmeroAleatorio == 3 {
				alert("Paper - Scissors", "You lost!")
				@Derrotas = @Derrotas + 1
			} else {
				alert("Paper - Paper", "Tie!")
				@Empates = @Empates + 1
			}
		} else {
			alert("Paper - Rock", "You won!")
			@Victorias = @Victorias + 1
		}
	item "Scissors ✂️":
		const NmeroAleatorio1 = randomNumber(1, 3)
		if NmeroAleatorio1 >= 2 {
			if NmeroAleatorio1 == 3 {
				alert("Scissors - Scissors", "Tie!")
				@Empates = @Empates + 1
			} else {
				alert("Scissors - Paper", "You won!")
				@Victorias = @Victorias + 1
			}
		} else {
			alert("Scissors - Rock", "You lost!")
			@Derrotas = @Derrotas + 1
		}
	item "- Stats -":
		const ResultadoDelClculo = @Victorias / @Derrotas
		ceil(ResultadoDelClculo, "Hundredths")
		@WL
		menu "" {
		item "Wins - {@Victorias}":
			nothing()
		item "Losses - {@Derrotas}":
			nothing()
		item "Ties - {@Empates}":
			nothing()
		item "W / L ratio - {@WL}":
		item :
			menu "Are you sure you want to reset your stats?" {
			item "Yes":
				@Victorias = 0
				@Derrotas
				@Empates
			item "No":
			}
		}
	}
	const Diccionario1 = {
		"Loses_Count": "{@Derrotas}",
		"Ties_Count": "{@Empates}",
		"Wins_Count": "{@Victorias}"
	}
	saveFile("PPTstats.json", Diccionario1, true)
}
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Advertisement

More by beastbeats

See All

You Might Also Like

See All
Advertisement