Scan with your iPhone to install
Play The Game, it’s fun.
What's New
Version 1.0
First release
What it does
29 actions-
CommentThis shortcut is public. View it at https://shortcutstudio.app/marketplace-item.html?id=309eee8f-5512-4fe5-82e1-e70551a242d7
-
Number
-
Set VariableuserScore
-
Number
-
Set VariableshortcutScore
-
Random Number
-
Ask for InputGuess the shortcut's number (1-10):
-
Text
-
Text
-
Text
-
If
-
Calculate
-
Set VariableuserScore
-
Show Result
-
If
-
Show Result
-
Ask for InputChoose a number for the shortcut to guess (1-10):
-
Random Number
-
Text
-
Text
-
Text
-
If
-
Calculate
-
Set VariableshortcutScore
-
Show Result
-
If
-
Show Result
-
Text
-
Show Result
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#define glyph magicWandAlt
// This shortcut is public. View it at https://shortcutstudio.app/marketplace-item.html?id=309eee8f-5512-4fe5-82e1-e70551a242d7
@userScore = 0
@shortcutScore = 0
const ShortcutNumber = randomNumber(1, 10)
const UserGuess = prompt("Guess the shortcut's number (1-10):", "Number", false)
const Text_userGuess = "{}"
const Text_shortcutNumber = "{ShortcutNumber}"
if Text_userGuess == Text_shortcutNumber {
@userScore = @userScore + 15
show("Correct! You get 15 points.")
} else {
show("Wrong! You get 0 points.")
}
const UserNumber = prompt("Choose a number for the shortcut to guess (1-10):", "Number", false)
const ShortcutGuess = randomNumber(1, 10)
const Text_shortcutGuess = "{ShortcutGuess}"
const Text_userNumber = "{}"
if Text_shortcutGuess == Text_userNumber {
@shortcutScore = @shortcutScore + 15
show("Shortcut guessed your number! Shortcut gets 15 points.")
} else {
show("Shortcut guessed wrong! Shortcut gets 0 points remain 0.")
}
const FinalText = "Final Scores:\nYou: {@userScore}\nShortcut: {@shortcutScore}"
show(FinalText)
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 boomchickaboomboom
You Might Also Like
Advertisement