Lesson 1.2 complete

This commit is contained in:
DESKTOP-8HAFCLV\Yugr 2025-06-26 21:11:50 +04:00
parent 4f1310bbcf
commit 16cc913cad
1 changed files with 18 additions and 9 deletions

View File

@ -1,11 +1,20 @@
import readline from 'node:readline'; function DrawLine(count: number){
const minimalString = '*';
console.log(minimalString.repeat(count));
}
let chisloN: number = 10;
//i++ => i = i + 1
//i-- => i = i - 1
//--i => i = i - 1
// for(let i = 0; i < count; i++){
// str = str + '*' // i = 0 => str = '*' // i == 1 => '**' // i = 2 => '***'
// }
for(let index = 1; index <= chisloN; index++){
DrawLine(index);
}
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.question('Enter something', value => {
console.log(`Hi ${value}`);
rl.close;
});