Skip to content
Advertisement

Draw an ASCII diamond in a frame

I am trying to draw out a diamond in a frame. I figured my way through the top half, but when I come to the 2nd half I had attempted to invert the loops and problems came up. I played around switching operators just to see the result, but still nothing works. Please help. What am I not seeing.

JavaScript

Advertisement

Answer

I assume you’re trying to achieve this result:

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement