I wrote the code on my laptop, then copied it to the platform!
I just refreshed the platform now and re-copied it, and everything went well.
Thank you for the support, and sorry for the inconvenience
I've already tested it, and it doesn't return ['*'] for 1. Use Pythontutor to see what your code does, step by step. It doesn't enter in any of your loops and it returns an empty array.
My code only return [] when the passed in nFloors is 0 or " " or NaN
When the passed in nFloors is 1, my code will return ['*']
I have ran test on my code severally and it statified tthe descriptions and sample test on the page.
I will like to pass my code to you to test, if possible
My code statify all the description and sample tests
Apart from nFloors parameter that is less than one or empty string, what are the other conditions that will return []
that is, expected [] to deeply equal [ '*' ]
I must have missed that out, while I was typing the solution to the platform, after I have worked and tested the code with vim and vimspector
I wrote the code on my laptop, then copied it to the platform!
I just refreshed the platform now and re-copied it, and everything went well.
Thank you for the support, and sorry for the inconvenience
I've already tested it, and it doesn't return
['*']
for 1. Use Pythontutor to see what your code does, step by step. It doesn't enter in any of your loops and it returns an empty array.My code only return
[]
when the passed innFloors
is0
or" "
orNaN
When the passed in
nFloors
is1
, my code will return['*']
I have ran test on my code severally and it statified tthe descriptions and sample test on the page.
I will like to pass my code to you to test, if possible
No, but your code returns an empty array with that input and you can see that here: https://pythontutor.com/visualize.html#mode=edit
My code return
['*']
when the passed in nFloors is1
,anything less than one or NaN, it will return
[]
So what is the condition or case, that will make
towerbuilder()
to return['*']
other than1
?In that error message, your code is wrongly returning
[]
when it should be returning['*']
My code statify all the description and sample tests
Apart from nFloors parameter that is less than one or empty string, what are the other conditions that will return []
that is, expected [] to deeply equal [ '*' ]
The error, that I am getting from the Test and Sumbit, is expected [] to deeply equal [ '*' ]
and of the test sample Test.assertDeepEquals(towerBuilder(1), ["*"])
It only towerBuilder(1) that ought to returns ["*"]
Any passed parameter that less than 1 or " " will return []
What is _ expected [] to deeply equal [ '*' ] _ about?
No, there isn't.
Not a kata issue, the problem is in your code.
There might be a bug in the test code of this kata for javascript
JavaScript
in what language?
This comment is hidden because it contains spoiler information about the solution