Now you are probably wondering how a RTS mobile card game is related to programming. This is a short story about Apples Siri Shortcuts made everything possible.
What is Clash Royale?
Clash Royale mobile video game developed and published by Supercell. The game combines elements from collectible card games, tower defense, and multiplayer online battle arena that was released back in 2016.
Early on when the game was still fresh Supercell would release short limited time game modes to mix up gameplay. Two of first waves of game modes was the “King’s Cup Challenge” and “Blind Deck Challenge” which both contained variations of random decks for players to use. But with most things, these events came and went always leaving the feeling of wanting to play them a bit more.
Release of Deck Links
Clash Royale would later push out a new feature called “Deck Links” this would be a feature to allow you to send your friends links to your favorite decks. I immediately started sharing decks with my friends when I began to notice the link format.
link.clashroyale.com/deck/en?deck=26000009;26000037;28000008;26000000;26000045;26000014;28000009;26000041
There were 8 cards in every deck… and there were 8 string IDs in every link… so then my gears started to turn. every card must have a unique ID when generating these deck links. I then started to play around with moving and changing the ID’s around to see what would happen.
I would eventually manually log each deck ID and safe it in a draft Shortcut list.
Card Name | Card ID |
---|---|
Knight | 26000000 |
Archers | 26000001 |
Goblins | 26000002 |
Giant | 26000003 |
Pekka | 26000004 |
Golem | 26000009 |
… | … |
This would also lead to some fun (8 of the same card IDs):
link.clashroyale.com/en?clashroyale://copyDeck?deck=26000009;26000009;26000009;26000009;26000009;26000009;26000009;26000009;&slots=0;0;0;0;0;0;0;0&tt=159000000
This was all fun and all but the process of manually changing the deck link URLs was a slow and tedious process. I would ask myself: “There must be a way to automate this process?“. I would then remembered watching Apple’s WWDC 2018 Keynote where they announced a new app called Siri Shortcuts.
Along Came Siri
On September 17, 2018 Apple would release iOS 12 with contained a bunch of new features. One of these was the new Siri Shortcuts app (formerly Workflow). Shortcuts was a visual scripting application developed by Apple. But at the time as a 16 year old high school student I didn’t know that.
The gears started to turn once again… “what if I could use Shortcuts to create a Clash Royale Deck link generator?” This way my friends and I could play random decks whenever we wanted. So I got to work implementing my Card ID list and I got it up and running very quickly! It worked like a charm and my friends loved it.
Freshman Year
Fast forward a few years I start to take my first programming class in college. In this course we would go over the basics of programming such as variables, arrays, functions, loops and more. But I began to notice how these concepts seemed eerily familiar to me. I began to connect the dots of how a tool such as Siri Shortcuts was just a high-level, block-based visual programming language (Similar to Scratch).
This made the courses concepts easier to me for me to understand as is one of the main reasons I fell in love to programming and scripting to this day. I am by no means a master coder (I would say a beginner/novice) but I am happy I got exposed the this world as its a powerful tool I use every day in personal and professional applications.
Programming has opened a lot of doors to me. Such as joining the Computer Science Club, participating in hackathons, leading to life-long friendships and more.
Hackathon (2023) and CSCI Club (2022)
![]()
Current Clash Royale Deck (10/12/2024)
PS
With the release of the iPhone 15 Pro and its Action Button. You can now map Siri Shortcuts to the button to trigger automations. I knew what I had to do…
5 Years later you can now swap random decks at the click off a button.