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
8c409948
Commit
8c409948
authored
Dec 05, 2023
by
Nurasyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
e21da739
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
index.js
JS/index.js
+15
-0
No files found.
JS/index.js
View file @
8c409948
...
@@ -8,8 +8,21 @@ function showStatic(correct, unCorrect, total) {
...
@@ -8,8 +8,21 @@ function showStatic(correct, unCorrect, total) {
`
);
`
);
};
};
function
iter
(
arr
,
num
)
{
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
if
(
i
===
parseInt
(
num
))
arr
[
i
].
total
.
push
(
parseInt
(
num
));
};
};
function
iterObject
(
arr
,
a
,
b
)
{
iter
(
arr
,
a
);
iter
(
arr
,
b
);
};
let
correct
=
[];
let
correct
=
[];
let
unCorrect
=
[];
let
unCorrect
=
[];
let
totalUnCorrect
=
[{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]},{
total
:
[]}];
while
(
true
)
{
while
(
true
)
{
let
firstNum
=
getRandomNum
();
let
firstNum
=
getRandomNum
();
...
@@ -20,12 +33,14 @@ while(true) {
...
@@ -20,12 +33,14 @@ while(true) {
if
(
!
answer
)
{
if
(
!
answer
)
{
showStatic
(
correct
.
length
,
unCorrect
.
length
,
correct
.
length
+
unCorrect
.
length
);
showStatic
(
correct
.
length
,
unCorrect
.
length
,
correct
.
length
+
unCorrect
.
length
);
console
.
log
(
totalUnCorrect
);
break
;
break
;
}
else
{
}
else
{
if
(
isNaN
(
parseInt
(
answer
)))
{
if
(
isNaN
(
parseInt
(
answer
)))
{
alert
(
"Введи число!"
);
alert
(
"Введи число!"
);
}
else
{
}
else
{
if
(
parseInt
(
answer
)
!==
parseInt
(
total
))
{
if
(
parseInt
(
answer
)
!==
parseInt
(
total
))
{
iterObject
(
totalUnCorrect
,
firstNum
,
secondNum
);
unCorrect
.
push
(
answer
);
unCorrect
.
push
(
answer
);
}
else
{
}
else
{
correct
.
push
(
answer
);
correct
.
push
(
answer
);
...
...
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