Ad
  • Custom User Avatar
  • Custom User Avatar

    Wow thank you, I didn't notice the not operator in the tests :)

  • Custom User Avatar

    That is a valid walk and your test (the one you've written in the sample tests) is testing for an invalid walk, see how are the sample tests:

    test.expect(is_valid_walk(['n','s','n','s','n','s','n','s','n','s']), 'should return True');
    test.expect(not is_valid_walk(['w','e','w','e','w','e','w','e','w','e','w','e']), 'should return False');
    test.expect(not is_valid_walk(['w']), 'should return False');
    test.expect(not is_valid_walk(['n','n','n','s','n','s','n','s','n','s']), 'should return False');
    
  • Custom User Avatar

    Hi!
    when I try my code (attempt button), some cases fail like this (output):
    It should work also for a ['e', 'w', 'e', 'w', 'n', 's', 'n', 's', 'e', 'w'] walk: False should equal True

    However, when I test my code (test button) with the failed ones, it passes. For example this works:
    test.expect(not is_valid_walk( ['e', 'w', 'e', 'w', 'n', 's', 'n', 's', 'e', 'w'] ), 'should return True');

    Is this a weird issue with my code or with the testing? Thanks!