2024-09-06 07:47:04 +00:00
|
|
|
let space = ' ';
|
|
|
|
let star = '*';
|
|
|
|
let bar = '|';
|
2024-09-10 09:11:52 +00:00
|
|
|
let magassag = 10;
|
|
|
|
let width = magassag * 2 - 1;
|
2024-09-06 07:47:04 +00:00
|
|
|
|
2024-09-10 09:11:52 +00:00
|
|
|
for (let i = 1; i < magassag + 1; i++){
|
2024-09-06 07:26:35 +00:00
|
|
|
|
|
|
|
let starnum = i + i - 1;
|
2024-09-10 09:11:52 +00:00
|
|
|
let spacenum = (width - starnum) / 2;
|
2024-09-06 07:26:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
let line = space.repeat(spacenum) + star.repeat(starnum) + space.repeat(spacenum);
|
|
|
|
|
|
|
|
console.log(line);
|
|
|
|
}
|
|
|
|
|
2024-09-10 09:11:52 +00:00
|
|
|
let spnum = (width - 3) / 2;
|
2024-09-06 07:47:04 +00:00
|
|
|
let barnum = 3;
|
2024-09-06 07:26:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < 2; i++){
|
2024-09-06 07:47:04 +00:00
|
|
|
let line = space.repeat(spnum) + bar.repeat(barnum) + space.repeat(spnum);
|
|
|
|
console.log(line);
|
2024-09-06 07:26:35 +00:00
|
|
|
}
|