Late to this, but in case anyone else stumbles across this and is stuck, here is my suggestion to the code above:
while switchCount < gemCount **|| gemCount < 1{**
movement()
collect()
toggle()
}
The issue is because both switchCount and gemCount are = 0. This prevents the while switchCount < gemCount loop to start. Adding || gemCount < 1, allows this loop to start.
Topic:
Developer Tools & Services
SubTopic:
Swift Playground
Tags: