This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <iostream> | |
#include <windows.h> | |
#include <conio.h> | |
using namespace std; | |
enum GameObject : short { HALL, WALL, COIN, ENEMY }; | |
enum Color : short { | |
BLACK, DARKBLUE, DARKGREEN, TURQUOISE, DARKRED, | |
PURPLE, DARKYELLOW, GREY, DARKGREY, BLUE, GREEN, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Content.jsx (родительская компонента): | |
import './Content.css'; | |
import {useContext, useState} from 'react'; | |
import {AppContext} from '../../contexts/AppContext.jsx'; | |
import {MyButton} from '../mybutton/MyButton.jsx'; | |
export function Content() { | |
const {theme, user} = useContext(AppContext); | |
// состояние для хранения количества кликов |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class MyComponent extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0 | |
}; | |
console.log('constructor'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
написать 2-3 класса, которые будут полезны для вашего будущего финального проекта по джаваскрипту (защита 06.06.2025). | |
постараться применить как можно больше особенностей синтаксиса джаваскрипт (паттерн mixin, деструктурирование и тд). | |
ЛИБО: | |
выполнить одно любое задание из 11, доступных по ссылкам: | |
https://materials.itstep.org/content/0fd326fe-d42a-4675-9567-5406be94a43b/ru | |
https://materials.itstep.org/content/a7d24cff-b237-4b2b-962f-68fc4f6bb8fb/ru |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class News { | |
constructor(title, date = new Date(), text, tags = []) { | |
this.title = title; | |
this.date = date; | |
this.text = text; | |
this.tags = tags; | |
} | |
print() { | |
document.write("<h1>"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html class="no-js" lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------111 1 | |
const comparaison = (a, b) => { | |
if (a < b) return -1; | |
if (a > b) return 1; | |
return 0; | |
} | |
//-----------------------------------------222 3 | |
const stringSum = (...numbers) => numbers.reduce((a, x) => a + x, 0).toString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <cstdlib> | |
#include <ctime> | |
#include <conio.h> | |
using namespace std; | |
enum direction { DOWN = 80, UP = 72, LEFT = 75, RIGHT = 77 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Почитать про систему прототипирования в JS: | |
https://learn.javascript.ru/function-prototype | |
https://learn.javascript.ru/native-prototypes | |
2. Выполнить первое или второе задание на выбор по ссылке: https://materials.itstep.org/content/4cff49e1-88fb-44a6-9b5d-f4ee836ef81c/ru | |
Использовать ключевое слово class, сделать три свойства и метод. В методе применить document.write() для генерации контента на странице. | |
Создать один или несколько объектов на основе класса, запустить метод, проверить что всё работает. | |
Ссылку на гист/репозиторий с решением прислать в комментарий к этому ДЗ. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------ 111 | |
// let input = prompt("Input number: "); | |
// let number = Number(input); | |
// | |
// if (isNaN(number)) | |
// { | |
// alert("Please enter a number"); | |
// } |
NewerOlder