add deleted no actual code

This commit is contained in:
Костя 2025-07-03 16:36:23 +03:00
parent ef7410dd10
commit dba600406a
2 changed files with 8 additions and 223 deletions

View File

@ -26,231 +26,16 @@
function SUMMA (chislo: number, chisloP: number){ function SUMMA (chislo: number, chisloP: number){
let funcres = chislo; let funcres = chislo;
//if (chislo / 3 == 1 || chislo / 3 == 2 || chislo / 3 == 3 || chislo / 3 == 4 || chislo / 5 == 1 ){ //пример кода статичный //if (chislo / 3 == 1 || chislo / 3 == 2 || chislo / 3 == 3 || chislo / 3 == 4 || chislo / 5 == 1 ){ //пример кода статичный
if (chislo / 3 >=1 && chislo / 3 == chisloP ){ //условие если переменная chislo делиться на 3 или на 5 то вывод на экран if (chislo / 3 >=1 && chislo / 3 == chisloP ){ //условие если переменная chislo делиться на 3 то вывод на экран и в массив
let array: number []= [funcres]; //массив let array: number []= [funcres]; //массив
console.log(array); console.log(array);
} }
} }
for(let index = 1; index < 10; ){ for(let index = 1; index < 10; ){
SUMMA(index, index - 2 );
index = index +1;
}
SUMMA(index, 1);
index = index + 1;
/*
console.log(`===================`)
const numbers = [funcres];
let sum = 0;
for (const num of numbers) {
sum += num;
} }
console.log(sum); */
// Вывод: 15
//console.log(`summa of numbre <1000: ${result}`);
/*
let duck1 = new RedDuck();
let duck2 = new GreyDuck();
let array: Eateable[] = [
duck1,
duck2
];
for (let item of array) {
item.eat();
}
let array2: Duck[] = [
duck2,
duck1
];
for (let item of array2) {
item.log();
}
array2.filter(item => "eat" in item); */
/*
function CalculateRectangleArea(sideA: number, sideB: number) : number {
return sideA * sideB;
}
//Virtual console
let chisloOne: string = '2';
let chisloTwo: string = 'A';
//Solution
let sideA = Number.parseInt(chisloOne, 10);
let sideB = Number.parseInt(chisloTwo, 10);
// && - AND
// || - OR
// !
if (Number.isNaN(sideA) || sideA <= 0 ){
console.log(`Your first value is invalid: ${sideA}`)
}
if (Number.isNaN(sideB) || sideB <= 0){
console.log(`Your second value is invalid: ${sideB}`)
}
else{
console.log(`Area of rectangle is: ${CalculateRectangleArea(sideA, sideB)}`);
} */
//***************************************************************
//#################### Примеры КОДА ##########################
/*
interface People {
name: string;
age: number | undefined;
}
let people01: People = {
name: "Kostya",
age: undefined
};
let people02: People = {
name: "Yura",
age: 32
}
people01.age = 60;
// console.log(people01);
// console.log(JSON.stringify(people01));
// console.log(people01.age);
console.log(`${people01.name} имеет возраст ${people01?.age ?? '40'}`); //Kostya --- 60
console.log(`${people02.name} имеет возраст ${people02?.age ?? '40'}`); //Yura --- 32
console.log(`${people01.name} имеет возраст ${people02?.age ?? '40'}`);
interface PeopleLocation extends People {
location: string;
}
let peopleLocation01: PeopleLocation = {
name: "djdf",
age: 42342,
location: "dafdf"
}
class ProcessingPeoples implements PeopleLocation {
name: string;
age: number | undefined;
location: string = '';
constructor(name: string){
this.name = name;
}
}
class ProcessingPeoplesExt extends ProcessingPeoples {
isActive: boolean = false;
constructor(name: string, isActive: boolean){
super(name);
if(isActive) {
this.location = 'Gorkyi street';
}
else{
this.location = '';
}
}
}
let a: ProcessingPeoples = new ProcessingPeoplesExt("Vasya", true);
class Duck {
type: string = 'Duck';
weight: number = 0;
log(){
console.log("I'm simple duck");
}
}
interface Eateable {
eat(): void;
}
class GreyDuck extends Duck implements Eateable{
constructor() {
super();
this.type = 'GreyDuck'
}
override log(){
console.log("I'm grey duck");
}
eat(){
console.log("I'm eat");
}
}
class RedDuck extends Duck implements Eateable {
constructor() {
super();
this.type = 'RedDuck'
}
eat(): void {
console.log("I'm eat");
}
override log(){
console.log("I'm red duck");
}
}
let duck1 = new RedDuck();
let duck2 = new GreyDuck();
let array: Eateable[] = [
duck1,
duck2
];
for (let item of array) {
item.eat();
}
let array2: Duck[] = [
duck2,
duck1
];
for (let item of array2) {
item.log();
}
array2.filter(item => "eat" in item);
*/
/*
function DrawLine(count: number, countP: number){ //рисуем треугольник из звездочек
const minimalString = '*';
const minimalP = ' ';
let result = minimalP.repeat(countP) + minimalString.repeat(count) //с начала рисуем пробелы (countP) а потом зведочки
console.log(result);
}
function DrawTriangle(height: number, chisloP: number) { //высота - это сколько рядов отрисует
for(let index = 1; index <= height; ){
DrawLine(index * 2 - 1, chisloP - index ); // вызываем функцию DrawLine внутри цикла, chisloN - нужно иметь МАКС значение как в первом уроке
index = index +1;
//console.log(height);
}
}
rl.question('Enter something', value => {
console.log(`Hi ${value}`);
rl.close;
});
*/

File diff suppressed because one or more lines are too long