김한준

누적 번호 보기 및 번호 추천 기능 추가

Showing 1 changed file with 111 additions and 1 deletions
var data;
var acum_list = new Array();
for (i=0;i<45;i++){
acum_list[i]=0;
}
$(document).ready(function () {
......@@ -48,6 +53,8 @@ function count() {
return a[0] - b[0];
};
$('#lottotable').html(""); //초기화
$('#accumulate_table').html(""); //초기화
$('#recom_table').html("");
var win1 = 0;
var win2 = 0;
var win3 = 0;
......@@ -131,6 +138,18 @@ function count() {
list += '<div class="output ' + num_class + '">' + val[j][0] + '</div>';
// console.log(match);
}
acum_list[val[0][0]-1]+=1;
acum_list[val[1][0]-1]+=1;
acum_list[val[2][0]-1]+=1;
acum_list[val[3][0]-1]+=1;
acum_list[val[4][0]-1]+=1;
acum_list[val[5][0]-1]+=1;
var win_class;
if (match == 6) {
win_class = 'win win1';
......@@ -167,9 +186,9 @@ function count() {
if (--i) engine(i);
}, 0)
})($('#inputnum').val());
var totalmatch = (win1 + win2 + win3 + win4 + win5)
var totalbuy = $('#inputnum').val();
}
function loadlot(a) {
......@@ -195,3 +214,94 @@ function loadlot(a) {
data = a;
}
function accumulate_number() {
/*
for(i=0;i<45;i++){
<-document.write((i+1)+"번 : "+acum_list[i]+"<br>");
}
*/
var temp= JSON.parse(JSON.stringify( acum_list ));
var out_temp= JSON.parse(JSON.stringify( acum_list ));
temp.sort(function(a,b){return a-b});
var recom_number = new Array();
$('#recom_table').append('<section id="recom_section" class="shadow"></scetion>');
for(i=44;i>=0;i--) {
for(j=0;j<45;j++){
if(temp[i]==out_temp[j]){
if(j<9)
$('#recom_section').append('<div class="output c1">'+(j+1)+'</div>'+'<progress value="' + temp[i] + '" max="' + (temp[44]+20)+ '"></progress>'+' '+temp[i]);
else if(j<19)
$('#recom_section').append('<div class="output c2">'+(j+1)+'</div>'+'<progress value="' + temp[i] + '" max="' + (temp[44]+20)+ '"></progress>'+' '+temp[i]);
else if(j<29)
$('#recom_section').append('<div class="output c3">'+(j+1)+'</div>'+'<progress value="' + temp[i] + '" max="' + (temp[44]+20)+ '"></progress>'+' '+temp[i]);
else if(j<39)
$('#recom_section').append('<div class="output c4">'+(j+1)+'</div>'+'<progress value="' + temp[i] + '" max="' + (temp[44]+20)+ '"></progress>'+' '+temp[i]);
else
$('#recom_section').append('<div class="output c5">'+(j+1)+'</div>'+'<progress value="' + temp[i] + '" max="' + (temp[44]+20)+ '"></progress>'+' '+temp[i]);
out_temp[j]=null;
if(i>38){
recom_number[44-i]=j+1;
}
break;
}
}
}
recom_number.sort(function(a,b){return a-b});
var numberSort = function(a, b) {
return a[0] - b[0];
};
$('#lottotable').html(""); //초기화
$('#accumulate_table').html(""); //초기화
var list = "";
var num_class= "c2 ";
list += '<div class="output ' + num_class + '">' + "3" + '</div>';
$('#accumulate_table').append('<section id="accumulate_section" class="shadow"></scetion>');
$("#accumulate_section").append('추천 로또 번호(누적 상위 6개)'+'</font>'+'<br>'+'<br>');
for (i = 0; i < 6; i++) {
if (recom_number[i] <= 10) {
$('#accumulate_section').append('<div class="output c1">'+recom_number[i]+'</div>');
} else if (recom_number[i] <= 20) {
$('#accumulate_section').append('<div class="output c2">'+recom_number[i]+'</div>');
} else if (recom_number[i] <= 30) {
$('#accumulate_section').append('<div class="output c3">'+recom_number[i]+'</div>');
} else if (recom_number[i] <= 40) {
$('#accumulate_section').append('<div class="output c4">'+recom_number[i]+'</div>');
} else {
$('#accumulate_section').append('<div class="output c5">'+recom_number[i]+'</div>');
}
}
}
function resets() {
$('#lottotable').html(""); //초기화
$('#accumulate_table').html(""); //초기화
$('#recom_table').html("");
$('#stats').html("");
for (i=0;i<45;i++){
acum_list[i]=0;
}
}
\ No newline at end of file
......