Ad
  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    @Voile

    We are discussing a solution. Are these comments visible to those who haven't solved the problem?

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    Works, thank you! Up to me to optimize the code now;)

  • Default User Avatar

    Another suggestion/issue: the description in Python says:

    As output you should return:

    1. the directions list

    It looks like the list of things to be returned is just the list of directions, so no need to number. It seems that previously there was a requirement to return the total cost (looking at @ZED.CWT's comments). Is this coming back as 2) in the list of things to be returned?

  • Default User Avatar

    Is there a problem with the python version? I get this error when I attempt:

    Traceback (most recent call last):
    File "main.py", line 57, in
    do_it()
    File "main.py", line 46, in do_it
    perform_testing([[1,19,1, 1,1],[1,19,1,19,1],[1,19,1,19,1],[1,19,1,19,1],[1, 1,1,19,1]], (0,0), (4,4))
    File "main.py", line 42, in perform_testing
    user, correct = cheapest_path(t_copy, start, finish), solve_the_kata(t, start, finish)
    File "main.py", line 28, in solve_the_kata
    for dx, dy in MOVES:
    NameError: name 'MOVES' is not defined

    many thanks! Sample tests work fine for me.

  • Default User Avatar

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

  • Default User Avatar

    Many thanks, much clearer now! Let me go solve it;)

  • Default User Avatar

    I would spell the details out, maybe like this:

    In this Kata, two players, Alice and Bob, are playing a palindrome game. Alice starts with string1, Bob starts with string2, and the board starts out as an empty string. Alice and Bob take turns; during a turn, a player selects a letter from his or her string, removes it from the string, and appends it to the board; if the board becomes a palindrome (of length >= 2), the player wins. Alice makes the first move. Since Bob has the disadvantage of playing second, then he wins automatically if letters run out and the board is never a palindrome. Note also that each player can see the other player's letters.

    The problem will be presented as solve(string1,string2). Return 1 if Alice wins and 2 it Bob wins.

  • Default User Avatar

    The statement is unclear. Please clarify that P1 and P2 are creating one string (I first read it as P1 a string separate from P2), that they are adding characters to the end of the string (is this correct?), and that you assume optimal strategy with full information (they see each other's hands).
    Interesting problem otherwise!

  • Loading more items...