ShareShortcuts

Guessing Game

Hello, this game Is an gussying game you have to know a number from 1 to 100

saif-munir
Fork “Guessing Game”

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 saif-munir 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
59K
Saved
0
Actions
30
Category
API
Version
1.0
Language
EN

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

Version History
1.0 May 15, 2020

First release

What it does

30 actions
  1. Comment
    By Lim Thye Chean Guess a number between 1-100. This version uses speech for input.
  2. Text
  3. Get Text from Input
  4. Repeat
  5. Random Number
  6. Set Variable
    answer
  7. Repeat
  8. Text
  9. Speak Text
  10. Dictate Text
  11. Round Number
  12. If
  13. If
  14. Text
  15. Speak Text
  16. If
  17. Text
  18. Speak Text
  19. Show Result
  20. Stop This Shortcut
  21. If
  22. If
  23. Text
  24. Speak Text
  25. If
  26. Text
  27. Speak Text
  28. Text
  29. Speak Text
  30. Show Alert
    Guessing Game

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/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

See All

You Might Also Like

See All
Advertisement