A Simple Card Trick
Saturday, 5 November, 2022
⨳ 1 minute read ⨳ 163 words ⨳ SwiftUI ⨳ app ⨳ iOS ⨳TLDR; I released my second iOS App.
Back in junior high school, my friend taught me a simple card trick:
- Deal out 21 cards in 3 rows of 7 cards each.
- Ask the person to remember their card and point to the row holding it.
- Collect rows.
- Repeat steps 1-3 two times.
- Flip over cards until just before you arrive at their card.
- Amaze them by having them flip over their own card.
Underneath this trick is simple sorting.
I thought it’d be a fun little challenge to make an app to replicate the majority of the trick.
It’s got options for performing the trick with 15, 21, 27, 35, 45, 55, & 65 cards; the same process is at play, so really, the physical size of the device defines the upper limit of what’s usable.
Because I’m slightly lazy, I copied the same three view organization from do-over – Main view, About view, & Settings view.