If you look at the example, the place where it says (YOU ARE HERE AT THE FRONT OF THE QUEUE) is not where the array starts when given to you.
(THE ARRAY STARTS HERE) [sheep, sheep, sheep, sheep, sheep, wolf, sheep, sheep] (YOU ARE HERE AT THE FRONT OF THE QUEUE)
So now when you are doing indexOf("wolf") in this instance you will get 5. Then you are doing -- which will give you the index of 4.
This will give you the wrong answer but a personal recommendation is to reverse the array when working with it.
Hope this helped :)!
Ruby translation added: https://www.codewars.com/kumite/5dd19a0df647ab0018f19cb8?sel=5dd19a0df647ab0018f19cb8
This comment is hidden because it contains spoiler information about the solution
rowcased is trying to say that it's lengTH and not lengHT.
Fixed. (I am not an expert at haskell testing, so it may not be the best way to do it, but oh well.
because lenght is not a thing in js
Print the input and you'll see when this is happening.
Haskell naming convention is camelCase, not snake_case
With this and the vast majority of katas the answer should be returned, rather than printed.
I see that you've completed lots of other katas, so you probably know that now. If not, let me know and I'll explain further.
@Unnamed, whatever. At the moment of publishing the description included zero information about how the sheep's number should be calculated. I interpreted it as "0-based ignoring the wolf", and it resulted in exactly the same value as if I interpreted it as "1-based". And still all the author does is provides specifications by example(!) in the discourse section(!!) of the kata, leaving the kata description totally unclear(!!!), which is ridiculous.
But now, after who knows how many description updates, the description should be correct now.