Ad
  • Default User Avatar

    Kind of. You're expanding the content of the variable, but if that has spaces then you've passed multiple arguments instead of a single argument:

    txt="a  b c"
    # echo $txt
    echo a  b c
    # echo's arguments (which includes its own name): ["echo", "a", "b", "c"]
    # note no spaces at all. the reason a space is there in the output is that
    # echo is putting a space between each arg when it prints them back out
    
    # echo "$txt"
    echo "a  b c"
    # echo's arguments: ["echo", "a  b c"]
    
  • Default User Avatar

    It wouldn't, but you need to make sure you're not splitting up the text into arguments anywhere, because then you've lost the delimiters.

  • Default User Avatar

    I don't see this behaviour in the tests. It's probably your code that is removing spaces, which is a very easy mistake to make in shell.

    Something is printing to stdout, not sure what (because I'm unfamiliar with cw's sh environment), but I noticed that two spaces look a lot like one space, it doesn't even add a single pixel for the second space. It's there if copied though. Kind of unfortunate font behaviour..

  • Default User Avatar

    i tried to improve the assertion messages, and added some input validation. if you want to train on this improved version, save your code somewhere, click the RESET button, and paste back your code.

  • Default User Avatar

    the logging for Shell in this kata is not ideal, but pasting your code and running the sample tests, i do see:

    testing: 835871232077058, 1
    expected: 30
    Shell Stdout
    29
    Test Failed
    expected: 30
         got: 29
    

    "shell stdout" means your answer here, while "expected" is the correct answer and 835871232077058, 1 the input

  • Default User Avatar

    That is only 14 requests. I figured you'd be too focused on checking that they didn't overlap to notice that one was missing, but by distributing them manually you wouldn't lose one of them due to some oversight or bug in the code that you wouldn't manually reproduce since you'd be aware of every step carried out.

  • Default User Avatar

    Yes, but you didn't distribute the requests between the taxis. Yes, check it by hand. Better yet, solve it by hand so that you are actually checking that it's solvable rather than looking at the solution and failing to find a problem (which doesn't mean there isn't one)

  • Default User Avatar

    You won't be able to distribute them between six taxis so it should be easy to figure it out why that's wrong