Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김한준
/
OSS-Term-Project
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김한준
2019-06-06 19:49:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
134d07d451d4b654eeca03bdec0e656fad78db12
134d07d4
1 parent
0c946822
API서버가 터져서 기존 기능들 다 삭제
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
11 deletions
js/data.js
js/ready.js
public/index.html
js/data.js
0 → 100644
View file @
134d07d
This diff is collapsed. Click to expand it.
js/ready.js
0 → 100644
View file @
134d07d
//회차별 당첨번호를 가지고 오기 위하여 테이블을 만들고 data를 가지고 오기 위해 주소를 변경하는 함수
$
(
document
).
ready
(
function
()
{
loadlot
(
1
);
var
dropdown
=
$
(
'#selectBox'
);
var
form
=
$
(
'#form'
);
var
result
=
$
(
'#result'
);
var
a2
=
$
(
'#a1'
);
for
(
i
=
1
;
i
<
862
;
i
++
)
{
var
option
=
$
(
'<option>'
);
option
.
val
(
i
).
text
(
i
+
'회차'
);
dropdown
.
append
(
option
);
}
form
.
on
(
'submit'
,
function
(
event
)
{
event
.
preventDefault
();
if
(
!
dropdown
.
val
())
{
alert
(
'뭔가 선택을 하세요.'
);
dropdown
.
focus
();
}
else
{
var
lotto_parent
=
document
.
getElementById
(
"winner"
);
for
(
i
=
0
;
i
<
7
;
i
++
)
{
if
(
i
==
6
)
{
var
lotto_child
=
document
.
getElementById
(
"output"
+
i
);
lotto_child
.
remove
();
$
(
"#plus"
).
after
(
'<div class="output" id=output'
+
i
+
'></div>'
);
}
else
{
var
lotto_child
=
document
.
getElementById
(
"output"
+
i
);
lotto_child
.
remove
();
$
(
"#plus"
).
before
(
'<div class="output" id=output'
+
i
+
'></div>'
);
}
}
loadlot
(
862
-
dropdown
.
val
());
/*
//회차별로 api에서 당첨번호를 끌어오기 위한 문자열 주소 조합
document.getElementById("lotto_api_src").src="http://lotto.kaisyu.com/api?method=get&gno="+dropdown.val()+";callback=loadlot";
//api에서 data를 끌어올때 최초 1회만 끌어올수 있는 문제를 해결하기 위한 방안
var lotto_parent = document.getElementById("lotto_api_data");
var lotto_child=document.getElementById("lotto_api_src");
lotto_child.remove();
child_node=document.createElement('script');
child_node.id="lotto_api_src";
lotto_parent.append(child_node);
*/
}
});
});
public/index.html
View file @
134d07d
...
...
@@ -7,21 +7,26 @@
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
>
<meta
name=
"theme-color"
content=
"#212121"
/>
<title>
로또 번호 생성기
</title>
<title>
Lotto 분석 및 생성
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/style.css"
>
<script
src=
"/jquery.js"
type=
"text/javascript"
></script>
<script
src=
"/main.js"
type=
"text/javascript"
></script>
<script
defer=
""
type=
"text/javascript"
src=
"http://lotto.kaisyu.com/api?method=get&callback=loadlot"
></script>
<script
src=
"/data.js"
type=
"text/javascript"
></script>
<script
src=
"/ready.js"
type=
"text/javascript"
></script>
<script
type=
"text/javascript"
src=
"https://www.gstatic.com/charts/loader.js"
></script>
<script
type=
"text/javascript"
>
google
.
charts
.
load
(
'current'
,
{
'packages'
:[
'corechart'
]});
</script>
<div
style=
"height:1800px; background-color: ivory"
>
</head>
<body>
<H2>
로또 번호 생성
&
당첨 확인
</H2>
<p>
로또 번호를 생성하고 각 회차의 당첨번호와 비교합니다
</p>
<p>
회차 선택시 1등 당첨번호가 바뀌며 선택한 회차의 당첨번호와
</p>
<p>
생성한 당첨번호를 비교하여 각 등수의 당첨확률을 보여줍니다
</p>
<H2>
Lotto 분석
&
번호 생성
</H2>
<p>
랜덤 생성 기능은 무작위로 번호를 생성하여 선택한 회차의 당첨번호와 비교합니다.
</p>
<p>
생성한 번호의 횟수를 누적하여 그 결과를 토대로 번호를 추천해줍니다.
</p>
<p>
역대 출현한 번호들의 누적횟수와 패턴을 통하여 랜덤하게 번호를 생성해줍니다.
</p>
<div
class=
"container"
>
<div
class=
"row p-4"
>
<div
class=
"col-xs-12"
>
...
...
@@ -41,9 +46,9 @@
</div>
<p
style=
"position:absolute;top:calc(35
% + 100px);width:100%;"
>
<p
id=
"event_section"
style=
"position:absolute;top:calc(38
% + 100px);width:100%;"
>
랜덤 번호 생성
<input
type=
"text"
id=
"inputnum"
value=
"5"
size=
"2"
>
번
<span
class=
"key"
onclick=
"count()"
>
시작
</span><span
class=
"key"
onclick=
"
accumulate_number()"
>
누적번호
&
번호추천
</span><span
class=
"key"
onclick=
"resets()"
>
초기화
</span>
accumulate_number()"
>
누적번호
&
번호추천
</span><span
class=
"key"
onclick=
"resets()"
>
초기화
</span>
<span
class=
"key"
onclick=
"graph_accum()"
>
패턴
&
번호추천
</span><span
class=
"key"
onclick=
"patten()"
>
역대 번호별 누적횟수
</span>
</p>
<section
id=
"winner"
class=
"shadow"
>
...
...
@@ -54,15 +59,31 @@ accumulate_number()">누적번호&번호추천</span><span class="key" onclick="
<div
class=
"output"
id=
"output3"
></div>
<div
class=
"output"
id=
"output4"
></div>
<div
class=
"output"
id=
"output5"
></div>
<div
class=
"output"
style=
"box-shadow:none; color:#000;"
>
+
</div>
<div
class=
"output"
style=
"box-shadow:none; color:#000;"
id=
"plus"
>
+
</div>
<div
class=
"output"
id=
"output6"
></div>
</section>
<div
id=
"lotto_api_data2"
>
<script
id=
"lotto_api_src2"
></script>
</div>
<div
id=
"stats"
></div>
<ol
id=
"lottotable"
></ol>
<ol
id=
"accumulate_table"
></ol>
<ol
id=
"recom_table"
></ol>
<ol
id=
"patten_table"
></ol>
<ol
id=
"patten_recom_table"
></ol>
<section
id=
"graph_section"
>
<div
id=
"chart_div_1"
></div>
<section
id=
"graph_section2"
>
<div
id=
"chart_div_2"
></div>
</section>
<section
id=
"graph_section3"
>
<div
id=
"chart_div_3"
></div>
<section
id=
"graph_section4"
>
<div
id=
"chart_div_4"
></div>
</section>
</body>
...
...
Please
register
or
login
to post a comment