const size = 5;
for (let i = 0; i < size; i++) {
for (let j = 0; j < size; j++) {
const diagonal = i === j;
const horizontal = i === 0;
const vertical = j === size - 1;
const clause = diagonal || horizontal || vertical;
print(clause ? "* " : " ");
}
newline();
}
To enter the code editing mode, press Enter. To exit the edit mode, press Escape
You are editing the code. To exit the edit mode, press Escape