0
let Code Coach: Popsicles in Swift 4
Does anyone tried and finished the Easy Code Coach Popsicles in Swift 4? I don't want you to post the code, because I already done Popsicles in all languages except Ruby which I'm learning now and Swift 4 which I finished earlier. But, Swift 4 is a horror programming language as I said in many comments throughout the SL course. So, I used readLine()! for getting the input (SL not even mention this function). Also, I used guard for the inputs and return to exit the guard. There I have an error, after I resolved many others. Again, Swift 4 is horror... like an Apple product.
2 Answers
+ 2
Romeo Cojocaru I've lost your message. But your first both input lines are right.
Then use only if/else.
And look at this:
if (variableA! % variableB! == 0) {
Do you see these "!" đ
+ 1
Yes, I did it just now.
W/o knowing swift. Needed some tryes.
Input with readLine() converted to Int and declared as not nil.
Modulo comparisation the same: Both variables declared as not nil.