Ad
  • Custom User Avatar
  • Default User Avatar

    Thank you!

  • Custom User Avatar
  • Default User Avatar

    How I solved the problem...
    1, Get something printed out. I tried print(players) and variants until print(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 error
    4, 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.

  • Custom User Avatar

    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.

  • Custom User Avatar