Ad
  • Default User Avatar

    Instead of saying - 1 * (expression), you could say - (expression), as boolean values are interpreted as 1 or 0 in arithmetic, and you can subtract those as well like you can do with (almost) any value.

  • Default User Avatar

    I missed the point that I know the number of pits

  • Custom User Avatar

    but there is one single pit, so it cannot be anywhere else than at (1,1)

  • Default User Avatar

    I fail to understand how this one could be True:


    _ _ _ _

    _ P _ _

    _ _ _ _

    _ W _ G

    The agent feels the wind in (0,1) and (1,0), but pits could be at (2,0) and (0,2).

  • Default User Avatar

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

  • Default User Avatar

    Hi @quedo - no the error is with your code. I pasted it into the editor and there's even a helpful error message explaining what is going wrong:

    Returned solution incorrect for fixed string = abcdefghijklmnopqrstuvwxyz: 
    
    'nopqrstuvwxy`abcdefghijklm' should equal 'nopqrstuvwxyzabcdefghijklm'
    

    Your code is not mapping the letter m to z correctly. The reason is that, for m the value of c that you are using corresponds to c=122. Now insert c=122 into your code and see what value appears after your calculations.

  • Default User Avatar

    It certainly works.

  • Custom User Avatar
  • Default User Avatar

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