Ad
  • Custom User Avatar

    If any single spin scores over 100, the entire input is invalid because scoring over 100 in a single spin is impossible according to the rules of the game. The situation described by the entire input is impossible. There are no players being punished, this isn't a game happening in real time, this is the results of a game being reported to your function. Because the input received by your function is impossible, the entire game is invalid.

    What SHOULD happen to the contestants in such a game is outside of the scope of this function. In a real world scenario, if this would happen, it's likely that the game show runners would make everyone re-spin because the wheel was found to be invalid. Somehow, a wheel with a value above 100 snuck its way onto the show. Your function is not required to make this decision, the function is only specced to report this situation as invalid. If this were a computer game, as a programmer, you could conclude that you have a bug somewhere else in the code, or you could come to a conclusion that one of the players were cheating, but without more information, it's impossible to say who it is (and it wouldn't be the job of this function to determine the cheater anyway). In this case, you'd still want to report this game as invalid.

    If a single over-100 score from a single player results in the entire game being returned "false," then why does the description even account for the case where ALL players break 100?

    It's not a single score (score being the result of two spins) being over 100 that results in false. It's possible for someone's score to be over 100 (for example, if they got two 70's), this would not invalidate the game. It's a single spin being over 100 that invalidates the game (again, because this should be impossible, meaning something went wrong before the scores ever got to your function).

  • Custom User Avatar

    I think there is a confusion between the value of the different rolls of the wheel and the total score (sum of the rolls).
    A score over 100 can occur, but a single roll of the wheel cannot exceed 100.

  • Custom User Avatar

    It is written in the description that numbers on the wheel are multiples of 5, ranging from 5 to 100.

  • Custom User Avatar

    Please note that inputs may be invalid: in this case, the function should return false.

  • Custom User Avatar

    The score for a single roll cannot exceed 100. Charlie's second roll (105) is not a valid input, hence it should return false.

  • Custom User Avatar

    width of the board is given to you as a parameter. If you know how many cells is there and you know the width of the board, figuring out the amount of rows should be trivial?

  • Custom User Avatar

    you can look at the test section to figure out that it doesn't tho. for context this is what is shown:
    {'t','u','p'},
    {'w','h','i'},
    {'t','s','u'},
    {'a','t','s'},
    {'h','a','p'},
    {'t','i','s'},
    {'w','h','s'}

    a lot of katas here have confusing instructions so i often look at the test section first before i start coding just to make sure i understand the instructions

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution