Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xy_camera
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
xy_camera
Commits
e446b90b
Commit
e446b90b
authored
Oct 09, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新增utils函数 between 用来返回三个数中中间的那个
parent
d1463387
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
utils.js
play/assets/tmpGame/script/utils.js
+4
-0
No files found.
play/assets/tmpGame/script/utils.js
View file @
e446b90b
...
@@ -52,6 +52,10 @@ export function RandomInt(a, b = 0) {
...
@@ -52,6 +52,10 @@ export function RandomInt(a, b = 0) {
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
)
+
min
);
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
)
+
min
);
}
}
export
function
Between
(
a
,
b
,
c
)
{
return
[
a
,
b
,
c
].
sort
((
a
,
b
)
=>
a
-
b
)[
1
];
}
export
function
randomSortByArr
(
arr
)
{
export
function
randomSortByArr
(
arr
)
{
const
newArr
=
[];
const
newArr
=
[];
const
tmpArr
=
arr
.
concat
();
const
tmpArr
=
arr
.
concat
();
...
...
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