I know I'm late to this reply, but if anyone else stumbles across this and is stuck, my suggestion:
while switchCount < gemCount || gemCount < 1{
movement()
collect()
toggle()
}
The original post wouldn't run as both gem and switch count were at 0 and the while loop depended on switchCount < gemCount. This allows the loop to start and will stop when switchCount > gemCount.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags: