Отсканируй на iPhone, чтобы установить
Play The Game, it’s fun.
Что нового
Версия 1.0
First release
Что делает
Действий: 29-
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
Посмотреть как код
Все действия этой команды, записанные на Cherri — языке программирования для приложения «Быстрые команды». Отлично подходит, чтобы разобраться, как она работает.
#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)
Открыть в Cherri Playground
Декомпилировано с помощью cherri 2.3.0 (GPL-2.0). Перед компиляцией могут понадобиться небольшие исправления.
Оценки и отзывы
Написать отзыв–
из 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Пока нет отзывов. Поделись мнением первым!
Реклама
Ещё от boomchickaboomboom
Вам также может понравиться
Реклама