Guessing Game
Hello, this game Is an gussying game you have to know a number from 1 to 100
saif-munirScan with your iPhone to install
Hello, this game Is an gussying game you have to know a number from 1 to 100
What's New
Version 1.0
First release
What it does
30 actions-
CommentBy Lim Thye Chean Guess a number between 1-100. This version uses speech for input.
-
Text
-
Get Text from Input
-
Repeat
-
Random Number
-
Set Variableanswer
-
Repeat
-
Text
-
Speak Text
-
Dictate Text
-
Round Number
-
If
-
If
-
Text
-
Speak Text
-
If
-
Text
-
Speak Text
-
Show Result
-
Stop This Shortcut
-
If
-
If
-
Text
-
Speak Text
-
If
-
Text
-
Speak Text
-
Text
-
Speak Text
-
Show AlertGuessing Game
View as code
Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.
#include 'actions/text'
#define color red
#define glyph gameController
/*
By Lim Thye Chean
Guess a number between 1-100.
This version uses speech for input.
*/
const Text = "Guessing Game.\n\nThis game let you guess a number between 1 to 100.\nYou only have 10 chances."
getText(Text)
const IfResult = repeat _ for 100 {
randomNumber(1, 100)
@answer
repeat _ for 10 {
speak(, "en-US")
const DictatedText = listen()
const RoundedNumber = round(DictatedText)
if RoundedNumber == @answer {
if @RepeatIndex2 < 6 {
speak(, "en-US")
} else {
speak(, "en-US")
}
show("You win!\nThe answer is {@answer}.")
stop()
} else {
if RoundedNumber > @answer {
speak(, "en-US")
} else {
speak(, "en-US")
}
}
}
speak(, "en-US")
alert(, "Guessing Game")
}
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 saif-munir
You Might Also Like
Advertisement