package com.tistory.wonsama;
import com.tistory.wonsama.utils.WNumberUtil;
public class Lotto {
///////////////////////////////////////////////////////////////////////
//
// final
//
private final int POP_COUNT = 6;
private final int L_MAX = 45;
private final int GAME_COUNT = 5;
///////////////////////////////////////////////////////////////////////
//
// init
//
public static void main(String[] args)
{
new Lotto();
}
public Lotto()
{
int[][]exceptNumbers = {
{13, 25, 27, 34, 38, 41},
{12, 24, 33, 38, 40, 42},
{8, 10, 18, 30, 32, 34},
{12, 15, 20, 24, 30, 38},
{6, 14, 19, 21, 23, 31},
{3, 10, 20, 26, 35, 43},
{3, 7, 13, 27, 40, 41},
{2, 7, 8, 9, 17, 33},
{1, 11, 12, 14, 26, 35},
{13, 20, 21, 30, 39, 45}
};
startGame(exceptNumbers, GAME_COUNT);
}
///////////////////////////////////////////////////////////////////////
//
// methods
//
private void startGame(int[][]exceptNumbers, int gameCount)
{
int[] totalNumbers = new int[exceptNumbers.length*(L_MAX-POP_COUNT)];
for(int i=0;i<exceptNumbers.length;i++)
{
WNumberUtil.pushNumbers(totalNumbers, WNumberUtil.exceptNumbers(genLottoNumbers(), exceptNumbers[i]), i*(L_MAX-POP_COUNT) );
}
for(int i=0;i<gameCount;i++){
System.out.println(WNumberUtil.popRandomUniqueNumer(totalNumbers, POP_COUNT));
}
}
private int[] genLottoNumbers()
{
int[] source = new int[L_MAX];
for(int i=0;i<L_MAX;i++)
{
source[i] = i+1;
}
return source;
}
}