-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTyping.html
More file actions
38 lines (31 loc) · 1.12 KB
/
Typing.html
File metadata and controls
38 lines (31 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<meta charset="utf-8">
<script>
function generateText(letters, length)
{
var text = "";
for (var i = 0; i < length; i++)
{
var n = getRandomNumber(letters.length - 1);
text += letters[n];
}
return text;
}
function getRandomNumber(max)
{
return Math.round(Math.random() * max);
}
alert("Вас приветствует программа по обучению слепой печати");
while (true)
{
alert("Положите 4 пальца левой руки - мизинец, безымянный, средний и указательный - на клавиши ф, ы, в, а. Запомните, что буква А находится под вашим указательным пальцем, а Ф - под мизинцем.\nТеперь неспеша набирайте текст. Постарайтесь не смотреть на клавиатуру.");
var text = generateText(["ф", "а"], 10);
var userText = prompt(text);
if (userText == text)
{
alert("Всё верно!");
break;
}
else
alert("Вы ошиблись. Попробуйте ещё раз ");
}
</script>