complete_rhombus-star_structure

Run Settings
LanguageJavascript
Language Version
Run Command
let i, j, k; let l = 1; let rows = 51; // let topPyramid = parseInt(rows/2 + (rows%2)); let spaceSec2 = 1; let lDown = rows - 2; let s = ''; for(i = 1; i <= rows; ++i){ if(i <= topPyramid){ for(j = i; j < topPyramid; ++j){ s+=' ' + ' '; } for(k = 1; k <= l; ++k){ s+='* '; } l+=2; } else { for(j = 1; j <= spaceSec2; ++j){ s+=' '+' '; } for(k = 1; k <= lDown; ++k){ s+='* '; } ++spaceSec2; lDown-=2; } console.log(s); s= ''; }
Editor Settings
Theme
Key bindings
Full width
Lines