diff --git a/src/index.ts b/src/index.ts index fb96a1f..0c3ffc1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,12 @@ -function DrawLine(count: number){ - const minimalString = '*'; - console.log(minimalString.repeat(count)); +function DrawLine(count: number, countP: number){ + const minimalString = '*'; + 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 @@ -13,8 +16,6 @@ let chisloN: number = 10; // str = str + '*' // i = 0 => str = '*' // i == 1 => '**' // i = 2 => '***' // } -for(let index = 1; index <= chisloN; index++){ - DrawLine(index); +for(let index = 1; index <= chisloN * 2; index = index + 2){ + DrawLine(index, chisloN * 2 -index); } - -