Yes, you can leave your solution under a spoiler tag if you need some help.
You are not providing your whole code. You excluded beginning and end of the function (though when you asked this question on forum you posted the whole code, not part of it), because of this we can see a correct loop, but we can't see your elsif right before the loop which has no condition to be tested on.
This comment is hidden because it contains spoiler information about the solution
Hi. What exactly is the problem with the while loop?
Already answered in your other post, the problem was you used elsif there:
There it was your = in a conditional
The current code works (see how you use proper markdown so your code doesn't lose indentation and such).
spoiler
tag if you need some help.forum
you posted the whole code, not part of it), because of this we can see a correct loop, but we can't see yourelsif
right before the loop which has no condition to be tested on.Also here it can't be marked as containing spoilers.
There it is your
=
in a conditionalThis is asking a wrong question in a wrong place...