Swift Collections and Control Flow
Control Flow With Loops
While and Repeat While
The video says it should go for 20 or 21 times.
It's likely an error in the condition of the loop, which is what determines when the loop ends. But I have to see your code to see precisely what the issue is. And the code is not currently attached to your post.
If you edit your post and paste in the code you are running then I can point out exactly what is happening.
Really frustrating that sometimes there is a checkbox to attach my code, sometimes there is not. No idea why.
Separately, a few moments later, Xcode crashed. I re-opened it, inputted same code and now it gives expected result. That was a great use of 20 minutes ?
No need to use the checkbox. You can just copy the code and enter it between these tags:
So you add 3 "ticks" like this one ` and name of the language and then close it with same 3 ticks but without the language name.
You also have a link for the "Markdown Cheatsheet" when writing a comment, just above the "Cancel" button ;)
thanks Emin - will keep that in mind in future posts!:)
Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.
I forgot my password