Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 108 additions & 0 deletions lesson4/Job2/lndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>job2</title>
</head>
<body>
<script>
/*
**************GOALKEEPER****************
-------------------------------------
| topleft | top | topright |
--------------------------
| left | center | right |
--------------------------
| bottomleft | bottom | bottomright |
--------------------------------------
*/

const sectors = [
'topleft',
'top',
'topright',
'left',
'center',
'right',
'bottomleft',
'bottom',
'bottomright',
];

const goalKeeper = {
defendSector: null,
savesToWin: 2,
saves: 0,
init() {
console.log('HERE');
const sectorNum = Math.trunc(Math.random() * 9);
this.defendSector = sectors[sectorNum];
console.log(this.defendSector);
},
checkWin(roundNumber) {
if (this.saves === this.savesToWin) {
console.log('Goalkeeper wins!!! Last Round is: ' + roundNumber);
return true;
}
console.log('Goalkeeper need ' + (this.savesToWin - this.saves) + ' more saves');
return false;
},
};


/* eslint no-param-reassign: 0 */
const attacker = {
sectorToAttack: null,
goals: 0,
goalsToWin: 10,
init(sector) {
if (sectors.indexOf(sector) >= 0) {
this.sectorToAttack = sector;
return true;
}
return false;
},
attack(keeper) {
console.log(keeper.defendSector, this.sectorToAttack);
if (keeper.defendSector === this.sectorToAttack) {
console.log('SAVE!!!');
keeper.saves++;
return false;
}
console.log('GOAL!!!');
this.goals++;
return true;
},
checkWin(roundNumber) {
if (this.goals === this.goalsToWin) {
console.log('Attacker wins!!! Last Round is: ' + roundNumber);
return true;
}
console.log('Attacker need ' + (this.goalsToWin - this.goals) + ' more goals');
return false;
},
};

function job1() {
let roundNumber = 0;
}

let keeperWins = false;
let attackerWins = false;

do {
let currentAttacksector;
console.log('Round - ' );
do {
currentAttacksector = prompt('Choose sector to attack ( ' + sectors.join(', ') + ' )');
} while (!attacker.init(currentAttacksector));

goalKeeper.init();
attacker.attack(goalKeeper);

keeperWins = goalKeeper.checkWin(roundNumber);
attackerWins = attacker.checkWin(roundNumber);
} while (!keeperWins && !attackerWins);
</script>
</body>
</html>
60 changes: 60 additions & 0 deletions lesson4/Who want to be a millionaire/lndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Кто хочет стать миллионером?</title>
</head>
<body>


<script>

alert(" Кто хочет стать миллионером?");

let questionList = [
' Что говорит человек, когда замечает нечто необычное?»?',
' Что помогает туристу ориентироваться в незнакомом городе??',
' В какой стране появилась мандолина?',
' Как жители Лондона прозвали небоскреб Мэри-Экс, спроектированный Норманом Фостером??',
' Какой врач первым в истории русской медицины применил гипсовую повязку?',
' Где в Древней Греции можно было увидеть надпись: «Здесь живут мертвые и говорят немые»?',
' Что написал Данте??',
' В какой стране был построен ледокол «Ермак»?',
' Какой наряд прославил баснописец Крылов??',
' Как звали старшую сестру императора Петра Первого?'];

let gain = [1000, 3000, 5000, 'первая несгораемая сумма 10000', 20000, 60000, 80000,
'вторая несгораемая сумма 100000', 500000, 1000000];

let answers = [['A: попало в лоб B: залетело в рот C: накапало в уши D: бросилось в глаза '],['A: путепровод B: путеукладчик C: путеводитель D:путеводная звезда '],['A: Испания B: Италия C: Венгрия D: Греция'],
['A: «корнишон» B: «баклажан» C: «кабачок» D: «патиссон»'],['A: Субботин B: Пирогов C: Боткин D: Склифосовский'],
['A: на кладбищах B: в больницах C: в библиотеках D: в тюрьмах'],['A: Божественную трагедию» B: Божественную комедию» C: Божественную драму» D: «Божественный фарс»'],
['A: Россия B: Германия C: Нидерланды D: Великобритания'],['A: тришкин кафтан B: ивашкин армяк C: рошкин зипун D: машкин сарафан'],
['A: Вера B: Надежда C: Любовь D: Софья']];

let correct = ['D','C','B','A','B','C','B','D','A','D'];

let a = 0;
let b = 1;
for(let i = 0; i < 10; i++) {
let answer = prompt('Вопрос ' + b + ': ' + questionList[i]+'\r\n'+ 'Варианты ответа: \r\n' + answers[0] + '\r\n' + 'Ваш ответ?');
if (answer.toUpperCase() == correct[0]) {
alert('Поздравляем вы выиграли ' + gain[a] + ' рублей');
a++;
b++;
answers.shift(0);
correct.shift(0);
}else if (gain[a] >= 100000){
alert('Ответ неверный. Вы выиграли ' + gain[7] + ' рублей');
break;
}else if (gain[a] >= 10000){
alert('Ответ неверный. Вы выиграли ' + gain[3] + ' рублей');
break;
}else{
alert('Ответ неверный');
break;
}
}
</script>
</body>
</html>
File renamed without changes.
Binary file added lesson5/img/400.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/26.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/27.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/28.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/30.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lesson5/img/chess/31.png
Binary file added lesson5/img/chess/32.png
Binary file added lesson5/img/chess/4.png
Binary file added lesson5/img/chess/5.png
Binary file added lesson5/img/chess/6.png
Binary file added lesson5/img/chess/7.png
Binary file added lesson5/img/chess/8.png
Binary file added lesson5/img/chess/9.png
21 changes: 21 additions & 0 deletions lesson5/lndex.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Шахматная доска</title>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<div class="Board">
<div class="wordBlack"></div>
<div class="numberWhite"></div>
<div class="numberBlack"></div>
<div class="board"></div>
<div class="wordWhite"></div>
</div>
</body>
</html>



58 changes: 58 additions & 0 deletions lesson5/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
window.onload = function () {

let letter = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
let word = document.querySelector('.wordWhite');
for (wnum = 0; wnum < letter.length; wnum++) {
let wordCell = document.createElement('div');
word.appendChild(wordCell);
wordCell.classList.add('wordCell');
wordCell.innerHTML = letter[wnum];
}
let word2 = document.querySelector('.wordBlack');
for (wnum = 0; wnum < letter.length; wnum++) {
let word2Cell = document.createElement('div');
word2.appendChild(word2Cell);
word2Cell.classList.add('wordCell');
word2Cell.innerHTML = letter[wnum];
}


let number = document.querySelector('.numberWhite');
for (num = 0; num < letter.length; num++) {
let numCell = document.createElement('div');
number.appendChild(numCell);
numCell.classList.add('numCell');
numCell.innerHTML = letter.length - num;
}
let number2 = document.querySelector('.numberBlack');
for (num = 0; num < letter.length; num++) {
let num2Cell = document.createElement('div');
number2.appendChild(num2Cell);
num2Cell.classList.add('numCell');
num2Cell.innerHTML = letter.length - num;
}


let chessBoard = document.querySelector('.board');
let i = 0;
for (count = 0; count < 8 * 8; count++) {
let cell = document.createElement('div');
chessBoard.appendChild(cell);
cell.classList.add('boardCell');

if (i % 2)
cell.classList.add('cellBlack');
i += ((i + 2) % 9) ? 1 : 2;


if (count < 16) {
let figureBoardB = document.createElement('img');
cell.appendChild(figureBoardB);
figureBoardB.setAttribute('src', 'img/chess/' + (count + 1) + '.png');
} else if (count > 47) {
let figureBoardW = document.createElement('img');
cell.appendChild(figureBoardW);
figureBoardW.setAttribute('src', 'img/chess/' + (count - 31) + '.png');
}
}
}
77 changes: 77 additions & 0 deletions lesson5/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.Board {
width: 490px;
height: 490px;
margin: 100px auto;
display: block;
background: url("img/400.jpg") no-repeat center;
}

.wordWhite {
width: 410px;
height: 40px;
padding: 0 38px;
background: #f9c6a0;
margin-top: -8px;
}

.wordBlack {
width: 410px;
height: 40px;
padding: 0 38px;
transform: rotate(180deg);
background: #f9c6a0;
}

.numberWhite {
width: 47px;
height: 410px;
float: left;
background: #f9c6a0;

}

.numberBlack {
width: 50px;
height: 395px;
float: right;
transform: rotate(180deg);
background: #f9c6a0;

}

.numCell {
height: 30px;
width: 45px;
text-align: center;
padding-top: 20px;
color: #12010b;
background: #f9c6a0;

}

.wordCell {
height: 30px;
width: 50px;
float: left;
padding-top: 10px;
text-align: center;
color: #11030e;

}

.board {
width: 400px;
height: 400px;
margin: 0 40px;

}

.boardCell {
width: 39px;
height: 39px;
float: left;
padding: 5px;
text-align: center;
}