add new value for chisloP

This commit is contained in:
Костя 2025-06-26 20:39:31 +03:00
parent 16cc913cad
commit 7f67cd98ca
1 changed files with 9 additions and 8 deletions

View File

@ -1,9 +1,12 @@
function DrawLine(count: number){ function DrawLine(count: number, countP: number){
const minimalString = '*'; const minimalString = '*';
console.log(minimalString.repeat(count)); const minimalP = ' ';
console.log(minimalP.repeat(countP)+minimalString.repeat(count));
} }
let chisloN: number = 10; let chisloN: number = 3;
//i++ => i = i + 1 //i++ => i = i + 1
//i-- => i = i - 1 //i-- => i = i - 1
@ -13,8 +16,6 @@ let chisloN: number = 10;
// str = str + '*' // i = 0 => str = '*' // i == 1 => '**' // i = 2 => '***' // str = str + '*' // i = 0 => str = '*' // i == 1 => '**' // i = 2 => '***'
// } // }
for(let index = 1; index <= chisloN; index++){ for(let index = 1; index <= chisloN * 2; index = index + 2){
DrawLine(index); DrawLine(index, chisloN * 2 -index);
} }