Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Yes. This code returns a boolean value and not a string.
Thank you!
thank you
How I solved the problem...
1, Get something printed out. I tried
print(players)
and variants untilprint(players[1].name)
returned 'b' which looked reasonable.2, I tried
return players[goose].name
, which returned incorrect letters.3, So I modified goose to make it return the correct letters...
return players[goose-1].name
got a few right then returned an out of range error4, so I started printing goose so I could see what values were out of range:
for i in range(30):
print('{} {}'.format(i, players[i].name))
return players[goose-1].name
From the result I found that the players array was 10 characters: abcdcefghz
5, We're getting in to spoiler territory here, but I realised the value needed to loop over the array, so either the array needs to be multiplied so that it's longer than 'goose' characters, or goose needs to be reduced to a value between 0 and 9.
6, I hope you enjoy solving the rest yourself.
This comments speaks to how I'm feeling right now. I'm only a month into learning Ruby part time and have been dismayed at my inability to do these "easy" katas without looking up syntax, or just plain having to look at the solution. Thanks for writing what you did its helped my confidence a little.
perhaps because CW test method is updated from == to === ;-)