🤯 Same condition. Same dice. while rolls 0 times. repeat-while rolls 6.
The only difference is who goes first 👇
🧵
🤯 Same condition. Same dice. while rolls 0 times. repeat-while rolls 6. The only difference is who goes first 👇 🧵
0 vue
Publié le 03/12/2026 06:27
1:12
🤯 Same condition. Same dice. while rolls 0 times. repeat-while rolls 6.
The only difference is who goes first 👇
🧵
⚡ repeat-while acts first, then checks. The body always runs at least once.
🎲 Last roll was a 6, roll until you get a 6.
✅ State may already be finished: while.
⚠️ If the first pass would be wrong on a finished state, don't use repeat-while.
🎓 Want to learn more? Check Mastering Swift - From Beginner to Advanced 👇
www.udemy.com/course/swift...