Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
classwork_21
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Нұрасыл Қайратұлы
classwork_21
Commits
e21da739
Commit
e21da739
authored
Dec 05, 2023
by
Nurasyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parents
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
index.js
JS/index.js
+36
-0
index.html
index.html
+13
-0
No files found.
JS/index.js
0 → 100644
View file @
e21da739
function
getRandomNum
()
{
return
Math
.
round
(
Math
.
random
()
*
9
)
};
function
mathOper
(
a
,
b
)
{
return
(
a
*
b
)
};
function
showStatic
(
correct
,
unCorrect
,
total
)
{
alert
(
`
Общ. -
${
total
}
Верные ответы -
${
correct
}
Не верные ответы -
${
unCorrect
}
`
);
};
let
correct
=
[];
let
unCorrect
=
[];
while
(
true
)
{
let
firstNum
=
getRandomNum
();
let
secondNum
=
getRandomNum
();
let
total
=
mathOper
(
firstNum
,
secondNum
);
const
answer
=
prompt
(
`Сколько будет
${
firstNum
}
*
${
secondNum
}
?`
);
if
(
!
answer
)
{
showStatic
(
correct
.
length
,
unCorrect
.
length
,
correct
.
length
+
unCorrect
.
length
);
break
;
}
else
{
if
(
isNaN
(
parseInt
(
answer
)))
{
alert
(
"Введи число!"
);
}
else
{
if
(
parseInt
(
answer
)
!==
parseInt
(
total
))
{
unCorrect
.
push
(
answer
);
}
else
{
correct
.
push
(
answer
);
};
};
};
};
\ No newline at end of file
index.html
0 → 100644
View file @
e21da739
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<script
src=
"./JS/index.js"
></script>
<title>
Document
</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment