Platforms tested: macOS. SwiftUI targets Apple platforms only, so this port isn't intended for Linux / FreeBSD / Windows.
A SwiftUI macOS version of the Swap Cups shell game. Three cups sit inverted on
a table; one hides a blue ball. You hide the ball, run a sequence of swaps
(A = left↔middle, B = middle↔right, C = left↔right), and find the ball
afterward.
- Pick a cup to hide the ball — it lifts and the ball flashes 7× so you can memorize the start.
- Each swap flashes green + blue dots over the two cups about to trade for ~1/3 second, then the cups slide past each other.
- After the run, tap any cup to lift it and reveal the flashing ball (7×) or an empty cup.
- macOS with Xcode (SwiftUI).
Open SwapCups.xcodeproj in Xcode and run the SwapCups scheme, or from the
command line:
xcodebuild -project SwapCups.xcodeproj -scheme SwapCups -destination 'platform=macOS' buildSwapCups/
├── SwapCups/
│ ├── SwapCupsApp.swift # @main App entry point
│ └── ContentView.swift # game view, model, and animation
└── SwapCups.xcodeproj
The same game in other stacks:
- SwapCups-Python — Python / tkinter
- SwapCups-wxWidgets — C++ / wxWidgets