-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnglish.html
More file actions
64 lines (55 loc) · 1.66 KB
/
English.html
File metadata and controls
64 lines (55 loc) · 1.66 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<meta charset="utf-8">
<script>
/*
var english = ["food", "bike", "apple", "do" , "mean"];
var russian = ["еда", "велосипед", "яблоко", "делать", "иметь в виду"];
*/
var words = [
["food", "еда"],
["bike", "велосипед"],
["apple", "яблоко"],
["do", "делать"],
["mean", "иметь в виду"]
];
while (words.length != 0)
{
var i = parseInt(Math.random() * words.length);
var userTranslate = prompt("Как переводится слово: " + words[i][0]);
if (userTranslate == words[i][1])
{
alert("Это правильный ответ!");
words.splice(i , 1);
}
else
alert("Правильный ответ: " + words[i][1]);
}
alert("Поздравляю, вы запомнили все слова!");
/*
alert(words[0]); // "food", "еда"
alert(words[1]); // "bike", "велосипед"
alert(words[0][0]); // "food"
alert(words[0][1]); // "еда"
alert(words[0][3]); // udefined
*/
var hardWords = [
["chainsaw", "бензопила"],
["squirrel", "белка"],
["castle", "замок"],
["homeland", "родина"],
["sewerage", "канализация"],
["bottom", "дно"]
];
while (hardWords.length != 0)
{
var i = parseInt(Math.random() * hardWords.length);
var userTranslate = prompt("Как переводится слово: " + hardWords[i][0]);
if (userTranslate == hardWords[i][1])
{
alert("Это правильный ответ!");
hardWords.splice(i , 1);
}
else
alert("Правильный ответ: " + hardWords[i][1]);
}
alert("Поздравляю, вы запомнили все слова!");
</script>