Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
36074e79
Commit
36074e79
authored
Jun 28, 2019
by
18김상언
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grade 인자로 받아서 단어 선택하도록 selectWord 수정
parent
6255f7ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
select.js
js/select.js
+10
-17
No files found.
js/select.js
View file @
36074e79
...
...
@@ -16,22 +16,15 @@ Select.selectstartWord = function() {
Select
.
startWordList
.
push
(
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade1
));
}
Select
.
selectWord
=
function
()
{
var
GradeProb
=
[];
//default: ?
var
rand
=
Math
.
random
();
var
selection
;
if
(
rand
<
GradeProb
[
0
])
{
//3급 단어 선택
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade3
);
}
else
if
(
rand
>=
GradeProb
[
0
]
&&
rand
<
GradeProb
[
1
])
{
//2급 단어 선택
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade2
);
}
else
if
(
rand
>=
GradeProb
[
1
]
&&
rand
<
GradeProb
[
2
])
{
//1급 단어 선택
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade1
);
}
else
{
//특급 단어 선택
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade0
);
Select
.
selectWord
=
function
(
grade
)
{
var
selection
=
""
;
switch
(
grade
)
{
case
3
:
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade3
);
break
;
case
2
:
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade2
);
break
;
case
1
:
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade1
);
break
;
case
0
:
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
gradeArray
.
grade0
);
break
;
default
:
break
;
}
return
selection
;
}
\ 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