Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I don't think this is 6kyu.
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:
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.
This comment is hidden because it contains spoiler information about the solution
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..
The random tests for the Shell implementation appears to occasionally add extra spaces to the output.
Encoded message:
tvg3swhprr hj,
My bash script works, but it is not efficient enough to finish within 12000 ms. I made my best attempt at translating my completed Python solution to bash, but unfortunately, the bash version is too slow. Any suggestions for improving efficiency in bash? I am using associative arrays to convert between letters and their decimal equivalent. Is there a better/faster way to do that in bash? Also I am using
bc
to handle most mathematical calculations.Thank your for the assistance. I was able to complete this kata. I believe my original issue was caused my use of addition
echo
commands (used for testing/debugging) prior to the finalecho
output. Once these commands were commented out, the logging recieved the correct values.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.
the logging for Shell in this kata is not ideal, but pasting your code and running the sample tests, i do see:
"shell stdout" means your answer here, while "expected" is the correct answer and
835871232077058, 1
the inputIs
echo
the proper way to return an output of a function in Bash? In my Bash script, I am storing the number of iterations ascounter
. My script finishes withecho $counter
and the value printed to the console matches the expected output, but the the testing script says that it got 0.Wow that is embarassing. Thank you for pointing out my error. I was certain that I had counted all 15 requests in my solution. I am ashamed of myself.
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.
I appreciate your patience with my ignorance. I solved the above example by hand and came out with the exact same taxis as above:
How are these not "distributed" correctly?
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)
Loading more items...