Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
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
Иван Кубота
kus-admin
Commits
1362f47a
Commit
1362f47a
authored
Jan 16, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print seed in log
parent
d44ffc72
Pipeline
#516
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
quizGenerator.js
public/js/controller/quizGenerator.js
+1
-1
rand.js
public/js/helpers/rand.js
+1
-1
No files found.
public/js/controller/quizGenerator.js
View file @
1362f47a
...
...
@@ -60,7 +60,7 @@ const quizGenerator = function(type, photo, subType) {
if
(
attempt
===
0
){
const
types
=
quizTypes
[
type
+
(
photo
?
'Photo'
:
''
)];
subType
=
probabilityRand
(
types
);
log
=
quizGenerator
.
log
=
[
'Quiz generate '
+
type
+
(
photo
?
' with photo'
:
''
)
+
' '
+
(
subType
?
`
${
lapk
(
subType
.
type
)}
`
:
'. FAIL'
)];
log
=
quizGenerator
.
log
=
[
'
Random seed: '
+
Math
.
random
.
seeded
.
getStringSeed
(),
'
Quiz generate '
+
type
+
(
photo
?
' with photo'
:
''
)
+
' '
+
(
subType
?
`
${
lapk
(
subType
.
type
)}
`
:
'. FAIL'
)];
}
else
if
(
attempt
<
30
){
log
=
quizGenerator
.
log
;
log
.
push
(
'
\
nATTEMPT FAILED!
\
n
\
n'
+
...
...
public/js/helpers/rand.js
View file @
1362f47a
...
...
@@ -13,7 +13,7 @@ function mulberry32(a) {
a
=
A
;
};
out
.
setStringSeed
=
function
(
str
)
{
str
=
str
.
replace
(
/
[^
0-9a-z
]
/g
,
''
);
str
=
str
.
replace
(
/
[^
0-9a-z
]
/g
,
''
)
.
substr
(
0
,
12
)
;
if
(
str
.
length
===
0
)
str
=
'1'
;
a
=
parseInt
(
str
,
36
);
};
...
...
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