I’ve done every task in my script, but when it comes to the tests, it randomly fails (tasks N° 7 to N° 13). I’ve carried out 20 runs, and here are the results:
I know there are similar topics, but I’ve made those recommendations that did not work.
Is there any way to see how those tests are?
Hi! Thanks for your answer!
I’ve changed the script to only count for valid numbers (I put line 14 into line 20 from number_guess.sh), but it still passes random tasks. It was my first try, but then I followed this solution..
What seems odd to me is that all tasks pass at least one test.
The logic of the code seems circular to me because one function calls another which then calls the function that called it which call the same function in a roundabout way.
So I would put some extra echo statements in the functions to track what is happening to the number of guesses in each function (print out the name of the function when the function is called and print out the number of guesses after each increment statement)
Also post what tasks 7-13 are so we can see if there is a clue there.
Well, thanks a lot finally worked!
I paid attention to what you said about calling each function several times, so I eliminated one of them. Now it works straightforwardly.