It makes me uncomfortable that this is 'build a tower', and not a pyramid
This comment is hidden because it contains spoiler information about the solution
this is an Object. The tests apparently want this.valueOf(), which is the primitive string within the object.
I'd say this is an issue. You're working on an Object ( because in a prototype method ); you should be able to return that Object ( you should also be able to return a primitive string ).
Note that primitive (!) strings are immutable, but String Objects are not, in that sense.
return? (note: I don't do C++, but...)
You may edit the description to fit to the selected language. I was confused by the ' ' in the examples because I thought that means the tower should have walls consisting of '
You can use the markdown language for it:
example for c# + python:
" * ",
" *** ",
" ***** ",
" ******* ",
" ********* ",
' * ',
' *** ',
' ***** ',
' ******* ',
' ********* ',
the kata wants space each floor too. for example if your tower's last floor has 6 star, than your first floor need to have 1 star and 5 spaces. your second floor needs to have 2 stars 4 spaces, your third floor needs to have 3 stars 3 spaces and goes on. you must add spaces too. i know, it is silly but kata's tests want it.
You have to return the recursive call too for it to work. Your code has another problem, don't use global vars, they keep their values between tests.
Seems you're "rather new" to cw, so here are some general guidelines about the comments:
When you post issues:
When you post a question: well, most of the above apply too x)
When you post code, use proper github markdown, so that it's readable.
And for your current problem, I don't do JS but... Are you sure you're actually returning something?
ahh.. you'll get it before the new year :)
Ufff, a long way to go, 96% left. So I guess by 2050 or so ;).
random question... what % to 1 Dan are you?