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
583d044d
Commit
583d044d
authored
Jun 28, 2019
by
16이지혜
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/wordgen'
parents
8433c7de
1080a28a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
CSVParsing.js
js/CSVParsing.js
+4
-4
select.js
js/select.js
+26
-3
No files found.
js/CSVParsing.js
View file @
583d044d
var
grade3Array
=
new
Array
()
;
var
grade2Array
=
new
Array
()
;
var
grade1Array
=
new
Array
()
;
var
grade0Array
=
new
Array
()
;
var
grade3Array
=
grade3Array
||
{}
;
var
grade2Array
=
grade2Array
||
{}
;
var
grade1Array
=
grade1Array
||
{}
;
var
grade0Array
=
grade0Array
||
{}
;
function
CSVParse
(
$data
)
{
var
allRows
=
$data
.
split
(
'
\n
'
)
...
...
js/select.js
View file @
583d044d
function
selectstartWord
()
{
var
i
;
var
grade3List
=
{}
;
var
grade2List
=
{}
;
var
grade1List
=
{}
;
var
grade3List
=
[]
;
var
grade2List
=
[]
;
var
grade1List
=
[]
;
for
(
i
=
0
;
i
<
5
;
i
++
)
{
...
...
@@ -16,4 +16,27 @@ function selectstartWord()
}
grade1List
[
0
]
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
grade1Array
);
}
function
selectWord
()
{
var
GradeProb
=
[];
//default: ?
var
rand
=
Math
.
random
();
var
selection
;
if
(
rand
<
GradeProb
[
0
])
{
//3급 단어 생성
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
grade3Array
);
}
else
if
(
rand
>=
GradeProb
[
0
]
&&
rand
<
GradeProb
[
1
])
{
//2급 단어 생성
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
grade2Array
);
}
else
if
(
rand
>=
GradeProb
[
1
]
&&
rand
<
GradeProb
[
2
])
{
//1급 단어 생성
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
grade1Array
);
}
else
{
//특급 단어 생성
selection
=
Phaser
.
Utils
.
Array
.
GetRandom
(
CSVParsing
.
grade0Array
);
}
}
\ 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