ShareShortcuts

Skins

For 2-4 players

gramps
Fork “Skins”

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 gramps 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
73
Category
Fun
Version
1.3
Language
EN

Preview

For 2-4 players. Calculates the bets after a game of golf skins. Optionally send the results by text. Optionally adds the results to a reminder for settling at the end of the season.

What's New

Version 1.3

Moved from the concept of holes to points to allow for more than holes to count, such as par 3s

Version History
1.3 Jun 29, 2020

Moved from the concept of holes to points to allow for more than holes to count, such as par 3s

1.2 Jun 13, 2020

Minor bug fix

1.1 Jun 13, 2020

Now with 2-4 players

1.0 Jun 6, 2020

First release

What it does

73 actions
  1. Comment
    Skins bet calculator Ver. 1.3 Jun 29, 20 (C) MCS
  2. Ask for Input
    No. Players? Must be between 2 and 4.
  3. Set Variable
    Players
  4. If
  5. If
  6. Show Alert
    Error
  7. Stop This Shortcut
  8. Ask for Input
    Each Point is worth? Eg: $0.50
  9. Set Variable
    Bet
  10. Ask for Input
    Player 1?
  11. Set Variable
    P1
  12. Ask for Input
    Points won by …
  13. Set Variable
    H1
  14. Ask for Input
    Player 2?
  15. Set Variable
    P2
  16. Ask for Input
    Points won by …?
  17. Set Variable
    H2
  18. If
  19. Ask for Input
    Player 3?
  20. Set Variable
    P3
  21. Ask for Input
    Points won by …?
  22. Set Variable
    H3
  23. If
  24. If
  25. Ask for Input
    Player 4?
  26. Set Variable
    P4
  27. Ask for Input
    Points won by …?
  28. Set Variable
    H4
  29. If
  30. Calculate
  31. Set Variable
    Points
  32. Calculate
  33. Set Variable
    Points
  34. Calculate
  35. Set Variable
    Points
  36. If
  37. Show Alert
    … Points detected!! Greater than 18 holes!!
  38. If
  39. Calculate
  40. Set Variable
    RiskedPerhole
  41. Calculate
  42. Set Variable
    Upforgrabs
  43. Calculate
  44. Set Variable
    Riskedandwon
  45. Calculate
  46. Set Variable
    W1
  47. Calculate
  48. Set Variable
    Riskedandwon
  49. Calculate
  50. Set Variable
    W2
  51. If
  52. Calculate
  53. Set Variable
    Riskedandwon
  54. Calculate
  55. Set Variable
    W3
  56. If
  57. If
  58. Calculate
  59. Set Variable
    Riskedandwon
  60. Calculate
  61. Set Variable
    W4
  62. If
  63. Show Alert
    Results
  64. Choose from Menu
    Share results via text messages?
  65. Choose from Menu
    Yes
  66. Send Message
  67. Choose from Menu
    No
  68. Choose from Menu
    Add results to Golf Bets reminders?
  69. Choose from Menu
    Yes
  70. Add New Reminder
  71. Choose from Menu
    No
  72. Show Alert
    Results
  73. Stop This Shortcut

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/sharing'
#define color teal
#define glyph personWalkingCane

/*
Skins bet calculator
Ver.  1.3
Jun  29, 20
(C) MCS
*/
prompt("No. Players?  Must be between 2 and 4. ", "Number")
@Players

if @Players <> 2 {
} else {
	alert("Invalid no. of Players - {@Players}", "Error")
	stop()
}
prompt("Each Point is worth?  Eg: $0.50", "Number")
@Bet
prompt("Player 1?")
@P1
prompt("Points won by {@P1}", "Number")
@H1
prompt("Player 2?")
@P2
prompt("Points won by {@P2}?", "Number")
@H2

if @Players > 2 {
	prompt("Player 3?")
	@P3
	prompt("Points won by {@P3}?", "Number")
	@H3
} else {
}

if @Players > 3 {
	prompt("Player 4?")
	@P4
	prompt("Points won by {@P4}?", "Number")
	@H4
} else {
}
@Points = @H1 + @H2
@Points = @Points + @H3
@Points = @Points + @H4

if @Points > 18 {
	alert("Are you sure you want to continue?", " {@Points} Points detected!!  Greater than 18 holes!! ")
} else {
}
@RiskedPerhole = @Bet * @Players
@Upforgrabs = @Bet * @Points
@Riskedandwon = @RiskedPerhole * @H1
@W1 = @Riskedandwon - @Upforgrabs
@Riskedandwon = @RiskedPerhole * @H2
@W2 = @Riskedandwon - @Upforgrabs

if @Players > 2 {
	@Riskedandwon = @RiskedPerhole * @H3
	@W3 = @Riskedandwon - @Upforgrabs
} else {
}

if @Players > 3 {
	@Riskedandwon = @RiskedPerhole * @H4
	@W4 = @Riskedandwon - @Upforgrabs
} else {
}
alert("\nDate: {CurrentDate}\nPlayers: {@Players}.    \nEach Point is worth: ${@Bet}\n\nPlayer.    Points.    Winnings.  \n{@P1}       {@H1}      ${@W1}  \n{@P2}      {@H2}      ${@W2}\n{@P3}      {@H3}      ${@W3} \n{@P4}      {@H4}      ${@W4}\n                   {@Points} Points\n\n(C) MCS 2020\n ", "Results")

menu "Share results via text messages?" {
item "Yes":
	sendMessage(, "Skins Game Results\nDate: {CurrentDate}\nPlayers: {@Players}.    \nEach Point is worth: ${@Bet}\n\nPlayer.    Points.    Winnings.  \n{@P1}       {@H1}      ${@W1}\n{@P2}      {@H2}      ${@W2}\n{@P3}      {@H3}      ${@W3} \n{@P4}      {@H4}      ${@W4}\n                   {@Points} Points\n\n(C) MCS 2020\n")
item "No":
}

menu "Add results to Golf Bets reminders?" {
item "Yes":
	rawAction("is.workflow.actions.addnewreminder", {
		"WFCalendarItemCalendar": "Golf Bets",
		"WFCalendarItemNotes": "Each Point is worth ${@Bet}\\n{@P1}         {@H1}      ${@W1}          {@P2}   {@H2}      ${@W2}\\n{@P3}         {@H3}     ${@W3}         {@P4}   {@H4}      ${@W4}\\n{@Points} Points",
		"WFCalendarItemTitle": "{CurrentDate}"
	})
item "No":
}
alert("\nDate: {CurrentDate}\nPlayers: {@Players}.    \nEach Point is worth: ${@Bet}\nPlayer.    Points.   Winnings.\n{@P1}       {@H1}      ${@W1}\n{@P2}      {@H2}      ${@W2}\n{@P3}      {@H3}      ${@W3}\n{@P4}      {@H4}      ${@W4}\n {@Points}Points\n\n(C) MCS 2020\n ", "Results")
stop()
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 gramps

See All

You Might Also Like

See All
Advertisement