{"id":2230,"date":"2008-12-21T11:03:08","date_gmt":"2008-12-21T11:03:08","guid":{"rendered":"http:\/\/192.168.0.71:9090\/?p=1922"},"modified":"2008-12-21T11:03:08","modified_gmt":"2008-12-21T11:03:08","slug":"java-lotto-simulator-%ec%9e%90%eb%b0%94-%eb%a1%9c%eb%98%90-%ec%8b%9c%eb%ae%ac%eb%a0%88%ec%9d%b4%ed%84%b0","status":"publish","type":"post","link":"https:\/\/talsu.net\/?p=2230","title":{"rendered":"Java Lotto Simulator (\uc790\ubc14 \ub85c\ub610 \uc2dc\ubbac\ub808\uc774\ud130)"},"content":{"rendered":"<p><\/p>\n<p><center>\uc790\ubc14\uac00 \uc124\uce58 \ub418\uc5b4 \uc788\uc5b4\uc57c \uc815\uc0c1\uc801\uc73c\ub85c \ubcf4\uc778\ub2e4. \ubcf4\uc774\uc9c0 \uc54a\uc73c\uba74 \uc544\ub798\uc758 \ub9c1\ud06c\ub85c \ub2e4\uc6b4 \ubc1b\ub294\ub2e4. <br \/>\n<iframe height=550 marginHeight=0 border=0 src=\"http:\/\/cfs.tistory.com\/custom\/blog\/6\/64757\/skin\/images\/javaLottoSimulator.html\" frameBorder=0 width=\"100%\" name=javaLotto marginWidth=0 scrolling=no><\/iframe><br \/>\n<\/center>Lotto Simulator \ub294 \ub85c\ub610 \ubcf5\uad8c\uc744 \uac00\uc0c1\uc73c\ub85c \ucd94\ucca8 \ud574 \ubcfc\uc218 \uc788\ub294 \ud504\ub85c\uadf8\ub7a8\uc774\ub2e4.<br \/>\n\uae30\ubcf8\uc801\uc778 \uc124\uc815\uc740 \uc624\ub9ac\uc9c0\ub110 \ub85c\ub610 \ubcf5\uad8c \uc14b\ud305 ( 6 \/ 45 + \ubcf4\ub108\uc2a4 ) \ub85c \ub418\uc5b4 \uc788\uace0<br \/>\n\uc0ac\uc6a9\uc790\uac00 \uc6d0\ud558\ub294 \uac12\uc73c\ub85c \ubcc0\uacbd\ub3c4 \uac00\ub2a5.<br \/>\n\ub9cc\uc57d \ubc94\uc704\ub97c \ubc97\uc5b4\ub09c \uac12\uc744 \ub123\uac70\ub098 \uc124\uc815\ud55c \uac2f\uc218\uc5d0 \ucd08\uacfc \ub610\ub294 \ubbf8\ub2ec \ud558\uba74 \uc54c\uc544\uc11c \ubb34\uc2dc\ud558\uac70\ub098 \ub79c\ub364\ud55c \uc218\ub97c \ubf51\uc544 \uc900\ub2e4. <\/p>\n<p>\uace0\uc18d\ubaa8\ub4dc\ub97c \uccb4\ud06c\ud558\uace0 \ucd94\ucca8\ud558\uba74 \uc911\uac04 \uacfc\uc815\uc744 \ucd9c\ub825 \ud558\uc9c0 \uc54a\uace0 \ub354\uc6b1 \ube60\ub978 \uc18d\ub3c4\ub85c \uacb0\uacfc\ub97c \ucd9c\ub825. <\/p>\n<p>\ud55c\ud559\uae30 \ub3d9\uc548 \uc790\ubc14\ub97c \uacf5\ubd80\ud558\uba74\uc11c \uc81c\uc77c \uba3c\uc800 \ub9cc\ub4e4\uc5b4\ubcf8 \uac04\ub2e8\ud55c \uc560\ud50c\ub9bf\uc774\ub2e4. <br \/>\n\uc7a5\uae30\uac04 \ud14c\uc2a4\ud2b8 \ud558\uace0 \uacb0\uacfc\uac00 \ud1b5\uacc4\uc640 \uc77c\uce58\ud568\uc744 \ud655\uc778\ud558\uc600\ub2e4. (1\ub4f1\uc740 \uc815\ub9d0 \ub2f9\ucca8 \ub418\uae30 \ud798\ub4e4\uc5c8\ub2e4.) <br \/>\n\uc9c1\uc811 \ub9cc\ub4e4\uc5b4\uc11c \uc2dc\ubbac\ub808\uc774\uc158 \ud574\ubd10\ub3c4 \ub85c\ub610\ub294 \uc0b4\uac83\uc774 \ubabb\ub418\ub294\uac83 \uac19\ub2e4.<\/p>\n<p>\uc544\ub798 \ud45c\ub294 \ub2f9\ucca8 \ud655\ub960\uc744 \uc815\ub9ac \ud574 \ub193\uc740\uac83\uc778\ub370 \ud504\ub85c\uadf8\ub7a8\uc744 \ud14c\uc2a4\ud2b8 \ud574\ubcf4\uba74 \ube44\uc2b7\ud558\uac8c \uacb0\uacfc\ub97c \uc5bb\uc744\uc218 \uc788\ub2e4.<br \/>\n(\ub9e4\uc6b0 \ud070 \uc218\ub85c \ud14c\uc2a4\ud2b8 \ud574\uc57c \uc2e0\ub8b0\uac00 \ub192\ub2e4.)<\/p>\n<table border=0 cellSpacing=1 cellPadding=3 width=\"100%\" bgColor=#707070>\n<tbody>\n<tr vAlign=center align=middle bgColor=#ececec>\n<td class=c width=45>\ub4f1\uc704<\/td>\n<td class=c>\ub2f9\ucca8 \uae30\uc900<\/td>\n<td class=c><font style=\"BACKGROUND-COLOR: rgb(255,0,0)\"><font color=#ffffff><strong>\ub2f9\ucca8 \ud655\ub960<\/strong> <\/font><\/font><\/td>\n<td class=c>\ub2f9 \ucca8 \uae08<\/td>\n<\/tr>\n<tr bgColor=#ffffff>\n<td class=c bgColor=#f8f8f8 align=middle>1 \ub4f1 <\/td>\n<td>6\uac1c \uc22b\uc790 \uc77c\uce58 (2\ub4f1 \ubcf4\ub108\uc2a4\uc22b\uc790 \uc81c\uc678) <\/td>\n<td><font style=\"BACKGROUND-COLOR: rgb(255,102,0)\" color=#ffffff><strong>1:8,145,060<\/strong> <\/font><\/td>\n<td>\ucd1d \ub2f9\ucca8\uae08 \uc911 5\ub4f1 \ub2f9\ucca8\uae08\uc744 \uc81c\uc678\ud55c \ub2f9\ucca8\uae08\uc758 60%<\/td>\n<\/tr>\n<tr bgColor=#ffffff>\n<td class=c bgColor=#f8f8f8 align=middle>2 \ub4f1 <\/td>\n<td>5\uac1c \uc22b\uc790 + 2\ub4f1 \ubcf4\ub108\uc2a4 \uc22b\uc790 \uc77c\uce58<\/td>\n<td><font style=\"BACKGROUND-COLOR: rgb(255,102,0)\"><font color=#ffffff><strong>1:1,357,510<\/strong> <\/font><\/font><\/td>\n<td>\ucd1d \ub2f9\ucca8\uae08 \uc911 5\ub4f1 \ub2f9\ucca8\uae08\uc744 \uc81c\uc678\ud55c \ub2f9\ucca8\uae08\uc758 10%<\/td>\n<\/tr>\n<tr bgColor=#ffffff>\n<td class=c bgColor=#f8f8f8 align=middle>3 \ub4f1 <\/td>\n<td>5\uac1c \uc22b\uc790 \uc77c\uce58 (2\ub4f1 \ubcf4\ub108\uc2a4 \uc22b\uc790 \uc81c\uc678)<\/td>\n<td><font style=\"BACKGROUND-COLOR: rgb(255,102,0)\"><font color=#ffffff><strong>1:35,724<\/strong> <\/font><\/font><\/td>\n<td>\ucd1d \ub2f9\ucca8\uae08 \uc911 5\ub4f1 \ub2f9\ucca8\uae08\uc744 \uc81c\uc678\ud55c \ub2f9\ucca8\uae08\uc758 10%<\/td>\n<\/tr>\n<tr bgColor=#ffffff>\n<td class=c bgColor=#f8f8f8 align=middle>4 \ub4f1 <\/td>\n<td>4\uac1c \uc22b\uc790 \uc77c\uce58 (2\ub4f1 \ubcf4\ub108\uc2a4 \uc22b\uc790 \uc81c\uc678) <\/td>\n<td><strong><font style=\"BACKGROUND-COLOR: rgb(255,102,0)\" color=#ffffff>1:733<\/font><\/strong><\/td>\n<td>\ucd1d \ub2f9\ucca8\uae08 \uc911 5\ub4f1 \ub2f9\ucca8\uae08\uc744 \uc81c\uc678\ud55c \ub2f9\ucca8\uae08\uc758 20%<\/td>\n<\/tr>\n<tr bgColor=#ffffff>\n<td class=c bgColor=#f8f8f8 align=middle>5 \ub4f1 <\/td>\n<td>3\uac1c \uc22b\uc790 \uc77c\uce58 (2\ub4f1 \ubcf4\ub108\uc2a4 \uc22b\uc790 \uc81c\uc678)<\/td>\n<td><font style=\"BACKGROUND-COLOR: rgb(255,102,0)\"><font color=#ffffff><strong>1:45<\/strong> <\/font><\/font><\/td>\n<td>5,000\uc6d0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2\uac1c\uc758 .java\ud30c\uc77c\ub85c \uc124\uacc4\ud558\uc600\ub2e4. \uccab\uc791\ud488\uc774\ub77c \ubbf8\ud761\ud55c \uc810\uc774 \ubcf4\uc778\ub2e4.<br \/>\n[#M_\uc18c\uc2a4\ubcf4\uae30 (\ud074\ub9ad)|\uc811\uae30|<br \/>\n<textarea class=java name=code cols=60 rows=10>import java.util.*;<\/p>\n<p>public class RandomLotto {<br \/>\n\tprivate int maxNumber;<br \/>\n\tprivate int numbers;<br \/>\n\tprivate int bonusNumber;<br \/>\n\tprivate Random rand = new Random();<br \/>\n\tprivate ArrayList&lt;Integer&gt; result = new ArrayList&lt;Integer&gt;();<\/p>\n<p>\tpublic RandomLotto() {<br \/>\n\t\tthis.maxNumber = 45;<br \/>\n\t\tthis.numbers = 6;<br \/>\n\t}<\/p>\n<p>\tpublic RandomLotto(int max, int num) {<br \/>\n\t\tthis.maxNumber = max;<br \/>\n\t\tthis.numbers = num;<br \/>\n\t}<\/p>\n<p>\tpublic int getBonusNumber() {<br \/>\n\t\treturn this.bonusNumber;<br \/>\n\t}<\/p>\n<p>\tpublic ArrayList&lt;Integer&gt; lottery(boolean tof) {<br \/>\n\t\tresult.clear();<br \/>\n\t\tlb1: while (result.size() != this.numbers) {<br \/>\n\t\t\tint temp = rand.nextInt(this.maxNumber) + 1;<br \/>\n\t\t\tfor (int j : result)<br \/>\n\t\t\t\tif (j == temp)<br \/>\n\t\t\t\t\tcontinue lb1;<br \/>\n\t\t\tresult.add(temp);<\/p>\n<p>\t\t}<br \/>\n\t\tif (tof) {<br \/>\n\t\t\tlb2: while (true) {<br \/>\n\t\t\t\tint temp = rand.nextInt(this.maxNumber) + 1;<br \/>\n\t\t\t\tfor (int i : result) {<br \/>\n\t\t\t\t\tif (i == temp)<br \/>\n\t\t\t\t\t\tcontinue lb2;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t\tthis.bonusNumber = temp;<br \/>\n\t\t\t\tbreak;<br \/>\n\t\t\t}<br \/>\n\t\t} else<br \/>\n\t\t\tthis.bonusNumber = 0;<br \/>\n\t\treturn result;<br \/>\n\t}<\/p>\n<p>\tpublic String getStringResult() {<br \/>\n\t\tString temp = new String();<br \/>\n\t\tfor (int i : result) {<br \/>\n\t\t\ttemp += String.format(&#8220;%02d   &#8220;, i);<br \/>\n\t\t}<br \/>\n\t\treturn temp;<br \/>\n\t}<\/p>\n<p>\tpublic double proba() {<br \/>\n\t\tdouble temp;<br \/>\n\t\tlong numX = 1;<br \/>\n\t\tlong maxnumber = this.maxNumber;<br \/>\n\t\tlong maxX = 1;<br \/>\n\t\tfor (int i = this.numbers; i &gt; 0; i&#8211;) {<br \/>\n\t\t\tnumX = numX * i;<br \/>\n\t\t\t;<br \/>\n\t\t\tmaxX *= maxnumber;<br \/>\n\t\t\tmaxnumber&#8211;;<br \/>\n\t\t}<br \/>\n\t\ttemp = maxX \/ (double) numX;<br \/>\n\t\tSystem.out.println(maxX);<br \/>\n\t\tSystem.out.println(numX);<br \/>\n\t\tSystem.out.println(temp);<br \/>\n\t\ttemp = numX \/ (double) maxX;<\/p>\n<p>\t\treturn temp;<br \/>\n\t}<\/p>\n<p>\tpublic String getStringResult(int[] a) {<br \/>\n\t\tString temp = new String();<br \/>\n\t\tfor (int i : a) {<br \/>\n\t\t\ttemp += String.format(&#8220;%02d   &#8220;, i);<br \/>\n\t\t}<\/p>\n<p>\t\treturn temp;<br \/>\n\t}<\/p>\n<p>\tpublic int getGrade(String str) {<br \/>\n\t\tint grade = 0;<br \/>\n\t\tgrade = this.compare(this.sort(this.getStringResult()), this.sort(str));<\/p>\n<p>\t\tif (this.bonusNumber == 0) {<br \/>\n\t\t\tgrade = this.numbers &#8211; grade + 1;<br \/>\n\t\t} else {<br \/>\n\t\t\tif ((this.numbers &#8211; grade) == 0) {<br \/>\n\t\t\t\tgrade = 1;<br \/>\n\t\t\t} else {<br \/>\n\t\t\t\tgrade = this.numbers &#8211; grade + 2;<br \/>\n\t\t\t\tif(this.compareBonus(this.sort(str))&amp;&amp; grade ==3){<br \/>\n\t\t\t\t\tgrade = 2;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t\treturn grade;<br \/>\n\t}<\/p>\n<p>\tpublic int[] sort(String str) {<br \/>\n\t\tStringTokenizer stk = new StringTokenizer(str, &#8220;t, &#8220;);<br \/>\n\t\tint[] tempInt = new int[this.numbers];<\/p>\n<p>\t\tfor (int i = 0; i &lt; tempInt.length; i++) {<\/p>\n<p>\t\t\tif (stk.hasMoreTokens())<br \/>\n\t\t\t\ttempInt[i] = Integer.parseInt(stk.nextToken());<br \/>\n\t\t\telse {<br \/>\n\t\t\t\tint temp;<br \/>\n\t\t\t\tlbWhile: while (true) {<br \/>\n\t\t\t\t\ttemp = rand.nextInt(this.maxNumber) + 1;<br \/>\n\t\t\t\t\tfor (int j : tempInt) {<br \/>\n\t\t\t\t\t\tif (j == temp)<br \/>\n\t\t\t\t\t\t\tcontinue lbWhile;<br \/>\n\t\t\t\t\t}<br \/>\n\t\t\t\t\tbreak;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t\ttempInt[i] = temp;<br \/>\n\t\t\t}<br \/>\n\t\t}<\/p>\n<p>\t\tArrays.sort(tempInt);<br \/>\n\t\treturn tempInt;<br \/>\n\t}<\/p>\n<p>\tpublic String strFilter(String str) {<br \/>\n\t\tStringTokenizer stk = new StringTokenizer(str, &#8220;t, &#8220;);<br \/>\n\t\tArrayList&lt;Integer&gt; intArr = new ArrayList&lt;Integer&gt;();<br \/>\n\t\tArrayList&lt;Integer&gt; intArr2 = new ArrayList&lt;Integer&gt;();<br \/>\n\t\tString strReturn = new String();<br \/>\n\t\twhile (stk.hasMoreTokens())<br \/>\n\t\t\tintArr.add(Integer.parseInt(stk.nextToken()));<br \/>\n\t\tfor (int i : intArr) {<br \/>\n\t\t\tif (intArr2.contains(i))<br \/>\n\t\t\t\tcontinue;<br \/>\n\t\t\tif (i &gt; this.maxNumber || i &lt; 1)<br \/>\n\t\t\t\tcontinue;<br \/>\n\t\t\tintArr2.add(i);<br \/>\n\t\t}<\/p>\n<p>\t\tfor (int i : intArr2) {<br \/>\n\t\t\tstrReturn += String.valueOf(i) + &#8221;   &#8220;;<br \/>\n\t\t}<\/p>\n<p>\t\treturn strReturn;<\/p>\n<p>\t}<\/p>\n<p>\tprivate boolean compareBonus(int[] arr) {<br \/>\n\t\tfor (int i : arr) {<br \/>\n\t\t\tif (i == this.bonusNumber)<br \/>\n\t\t\t\treturn true;<br \/>\n\t\t}<br \/>\n\t\treturn false;<\/p>\n<p>\t}<\/p>\n<p>\tprivate int compare(int[] a, int[] b) {<br \/>\n\t\tint resultInt = 0;<br \/>\n\t\tfor (int i : a) {<br \/>\n\t\t\tfor (int j : b) {<br \/>\n\t\t\t\tif (i == j)<br \/>\n\t\t\t\t\tresultInt++;<br \/>\n\t\t\t}<br \/>\n\t\t}<\/p>\n<p>\t\treturn resultInt;<br \/>\n\t}<\/p>\n<p>}<br \/>\n<\/textarea> <textarea class=java name=code cols=60 rows=10>import java.applet.*;<br \/>\nimport java.util.*;<br \/>\nimport java.awt.*;<br \/>\nimport java.awt.event.*;<\/p>\n<p>import javax.swing.GroupLayout.Alignment;<\/p>\n<p>public class Lotto extends Applet implements ActionListener {<br \/>\n\tRandomLotto rl;<br \/>\n\tprivate Label name = new Label(&#8220;Lotto Simulator&#8221;);<br \/>\n\tprivate TextArea ta = new TextArea();<\/p>\n<p>\tprivate Panel inputData1 = new Panel();<br \/>\n\tprivate Panel inputData3 = new Panel();<br \/>\n\tprivate Label lbNum = new Label(&#8220;\ubf51\ub294\uacf5\uc758 \uac2f\uc218 :&#8221;);<br \/>\n\tprivate TextField num = new TextField(3);<br \/>\n\tprivate Label lbMax = new Label(&#8221;     \ucd5c\ub300\uac12 :&#8221;);<br \/>\n\tprivate TextField max = new TextField(3);<br \/>\n\tprivate Label lbTry = new Label(&#8221;                 \uc2dc\ub3c4 \ud69f\uc218 :&#8221;);<br \/>\n\tprivate TextField tfTry = new TextField(6);<\/p>\n<p>\tprivate Panel inputData2 = new Panel();<br \/>\n\tprivate Label lbSelectedNumbers = new Label(&#8220;\uc120\ud0dd\ud560 \uc218 (ex: 2 16 32 7 45 28) :&#8221;);<br \/>\n\tprivate TextField selectedNumbers = new TextField(15);<br \/>\n\tprivate Label lbBonus = new Label(&#8221;     \ubcf4\ub108\uc2a4 \ubc88\ud638 :&#8221;);<br \/>\n\tprivate Checkbox cbBonus = new Checkbox();<\/p>\n<p>\tprivate Panel pnSpeed = new Panel();<br \/>\n\tprivate Label lbSpeed = new Label(&#8220;\uace0\uc18d \ubaa8\ub4dc(\ubf51\ub294\uc218\ub97c \ubcf4\uc9c0 \uc54a\uc74c) :&#8221;);<br \/>\n\tprivate Checkbox cbSpeed = new Checkbox();<\/p>\n<p>\tprivate Panel pnButton = new Panel();<br \/>\n\tprivate Button lottery = new Button(&#8220;\ucd94\ucca8 \uc2dc\uc791&#8221;);<br \/>\n\t\/\/private Button lotteryLucky = new Button(&#8220;\ub2f9\ucca8 \ub420\ub54c\uae4c\uc9c0 \ucd94\ucca8!&#8221;);<\/p>\n<p>\tprivate Panel option = new Panel(new GridLayout(8, 1));<br \/>\n\tprivate Panel result = new Panel(new BorderLayout());<br \/>\n\tprivate Panel control = new Panel(new BorderLayout());<br \/>\n\tprivate Label lbResult = new Label();<br \/>\n\tprivate Label lbResult2 = new Label(&#8220;\uac12\uc744 \uc785\ub825 \ud55c\ub4a4 \ucd94\ucca8 \uc2dc\uc791\uc744 \ub20c\ub824 \uc8fc\uc2ed\uc2dc\uc624&#8221;);<br \/>\n\tprivate Panel pLbg = new Panel(new GridLayout(1, 12));<br \/>\n\tprivate Label[] lbg = new Label[6];<br \/>\n\tprivate Label[] lbr = new Label[6];<br \/>\n\tprivate Font font = new Font(&#8220;Dialog&#8221;, Font.BOLD, 25);<\/p>\n<p>\tpublic void init() {<br \/>\n\t\tthis.setSize(600, 500);<br \/>\n\t\tGridBagLayout gridBag = new GridBagLayout();<br \/>\n\t\tthis.setLayout(gridBag);<br \/>\n\t\tGridBagConstraints gc = new GridBagConstraints();<br \/>\n\t\tlbMax.setAlignment(Label.RIGHT);<br \/>\n\t\tlbNum.setAlignment(Label.RIGHT);<br \/>\n\t\tlbSelectedNumbers.setAlignment(Label.RIGHT);<br \/>\n\t\tlbSpeed.setAlignment(Label.RIGHT);<br \/>\n\t\tlbTry.setAlignment(Label.RIGHT);<br \/>\n\t\tlbBonus.setAlignment(Label.RIGHT);<br \/>\n\t\tinputData1.add(lbNum);<br \/>\n\t\tinputData1.add(num);<br \/>\n\t\tinputData1.add(lbBonus);<br \/>\n\t\tinputData1.add(cbBonus);<\/p>\n<p>\t\tnum.setText(&#8220;6&#8221;);<br \/>\n\t\tmax.setText(&#8220;45&#8221;);<br \/>\n\t\ttfTry.setText(&#8220;100&#8221;);<\/p>\n<p>\t\tcbBonus.setState(true);<\/p>\n<p>\t\tinputData2.add(lbMax);<br \/>\n\t\tinputData2.add(max);<br \/>\n\t\tinputData2.add(lbTry);<br \/>\n\t\tinputData2.add(tfTry);<br \/>\n\t\tinputData3.add(lbSelectedNumbers);<br \/>\n\t\tinputData3.add(selectedNumbers);<\/p>\n<p>\t\tpnSpeed.add(lbSpeed);<br \/>\n\t\tpnSpeed.add(cbSpeed);<\/p>\n<p>\t\tpnButton.add(lottery);<\/p>\n<p>\t\tfor (int i = 0; i &lt; 6; i++) {<br \/>\n\t\t\tlbg[i] = new Label(String.valueOf(i + 1) + &#8220;\ub4f1 : &#8220;);<br \/>\n\t\t\tlbr[i] = new Label(&#8221; &#8220;);<br \/>\n\t\t\tpLbg.add(lbg[i]);<br \/>\n\t\t\tpLbg.add(lbr[i]);<br \/>\n\t\t}<br \/>\n\t\tname.setFont(font);<br \/>\n\t\tname.setAlignment(Label.CENTER);<br \/>\n\t\tlbResult2.setAlignment(Label.RIGHT);<br \/>\n\t\toption.add(name);<br \/>\n\t\toption.add(inputData1);<br \/>\n\t\toption.add(inputData2);<br \/>\n\t\toption.add(inputData3);<br \/>\n\t\toption.add(pnSpeed);<br \/>\n\t\toption.add(pnButton);<br \/>\n\t\toption.add(lbResult2);<\/p>\n<p>\t\tta.setEditable(false);<br \/>\n\t\tta.setBackground(Color.black);<br \/>\n\t\tta.setForeground(Color.white);<br \/>\n\t\tta.setText(&#8220;Lotto Simulator 0.4.1n&#8221;<br \/>\n\t\t\t\t+ &#8220;\ub9cc\ub4e0\uc774 : \uae40\ud615\uc870 (Talsu)nnLotto Simulator \ub294 \ub85c\ub610 \ubcf5\uad8c\uc744 \uac00\uc0c1\uc73c\ub85cn&#8221;<br \/>\n\t\t\t\t+ &#8220;\ucd94\ucca8 \ud574 \ubcfc\uc218 \uc788\ub294 \ud504\ub85c\uadf8\ub7a8 \uc785\ub2c8\ub2e4.nn&#8221; + &#8220;\uae30\ubcf8\uc801\uc778 \uc124\uc815\uc740 \uc624\ub9ac\uc9c0\ub110 \ub85c\ub610 \ubcf5\uad8c \uc14b\ud305n&#8221;<br \/>\n\t\t\t\t+ &#8220;( 6 \/ 45 + \ubcf4\ub108\uc2a4 ) \ub85c \ub418\uc5b4 \uc788\uace0, \uc0ac\uc6a9\uc790\uac00n&#8221;<br \/>\n\t\t\t\t+ &#8220;\uc6d0\ud558\ub294 \uac12\uc73c\ub85c \ubcc0\uacbd\ub3c4 \uac00\ub2a5 \ud569\ub2c8\ub2e4.nn&#8221; + &#8220;\uc790\uc2e0\uc774 \uc6d0\ud558\ub294 \ubc88\ud638\ub97c \uac2f\uc218\uc5d0 \ub9de\uac8c [\uc120\ud0dd\ud560 \uc218]\uc5d0n&#8221;<br \/>\n\t\t\t\t+ &#8220;\uc785\ub825 \ud558 [\ucd94\ucca8 \uc2dc\uc791]\ubc84\ud2bc\uc744 \ub20c\uba74 \ucd94\ucca8\uc744 n&#8221; + &#8220;[\uc2dc\ub3c4 \ud69f\uc218]\ub9cc\ud07c \uc2dc\ub3c4 \ud569\ub2c8\ub2e4.nn&#8221;<br \/>\n\t\t\t\t+ &#8220;\ub9cc\uc57d \ubc94\uc704\ub97c \ubc97\uc5b4\ub09c \uac12\uc744 \ub123\uac70\ub098 \uc124\uc815\ud55c \uac2f\uc218\uc5d0n&#8221; + &#8220;\ucd08\uacfc \ub610\ub294 \ubbf8\ub2ec \ud558\uba74 \uc54c\uc544\uc11c \ubb34\uc2dc\ud558\uac70\ub098 \ub79c\ub364\ud55cn&#8221;<br \/>\n\t\t\t\t+ &#8220;\uc218\ub97c \ubf51\uc544 \uc90d\ub2c8\ub2e4.nn&#8221; + &#8220;\uace0\uc18d\ubaa8\ub4dc\ub97c \uccb4\ud06c\ud558\uace0 \ucd94\ucca8\ud558\uba74 \uc911\uac04 \uacfc\uc815\uc744 \ucd9c\ub825n&#8221;<br \/>\n\t\t\t\t+ &#8220;\ud558\uc9c0 \uc54a\uace0 \ub354\uc6b1 \ube60\ub978 \uc18d\ub3c4\ub85c \uacb0\uacfc\ub97c \ucd9c\ub825 \ud569\ub2c8\ub2e4.nnn&#8221;<br \/>\n\t\t\t\t+ &#8220;\uac1c\uc120 \uc0ac\ud56d\uc774\ub098 \ubc84\uadf8\ub4e4\uc740 talsuspam@gmail.com\uc73c\ub85cn&#8221; + &#8220;\uc5f0\ub77d \uc8fc\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.n&#8221;);<\/p>\n<p>\t\tresult.add(&#8220;Center&#8221;, ta);<br \/>\n\t\tresult.add(&#8220;South&#8221;, lbResult);<br \/>\n\t\tcontrol.add(&#8220;Center&#8221;, option);<br \/>\n\t\tcontrol.add(&#8220;South&#8221;, lbResult2);<\/p>\n<p>\t\tgc.weightx = 1;<br \/>\n\t\tgc.weighty = 1;<br \/>\n\t\tgc.fill = GridBagConstraints.BOTH;<br \/>\n\t\tgridBag.setConstraints(result, gc);<br \/>\n\t\tthis.add(result);<br \/>\n\t\tgc.weightx = 1;<br \/>\n\t\tgc.weighty = 1;<br \/>\n\t\tgridBag.setConstraints(control, gc);<br \/>\n\t\tthis.add(control);<br \/>\n\t}<\/p>\n<p>\tpublic void start() {<br \/>\n\t\tlottery.addActionListener(this);<br \/>\n\t\t\/\/lotteryLucky.addActionListener(this);<br \/>\n\t}<\/p>\n<p>\tpublic void actionPerformed(ActionEvent e) {<\/p>\n<p>\t\tif (e.getSource() == lottery) {<\/p>\n<p>\t\t\tif (Integer.parseInt(max.getText()) &lt;= Integer.parseInt(num<br \/>\n\t\t\t\t\t.getText())) {<br \/>\n\t\t\t\tta<br \/>\n\t\t\t\t\t\t.setText(&#8220;\uc2e4\ud328 : \ubf51\ub294\uc218\uac00 \ucd5c\ub300\uc218 \ubcf4\ub2e4 \ud07d\ub2c8\ub2e4. nn\uc911\ubcf5\ub418\ub294 \uc218\ub294 \ubf51\uc9c0 \uc54a\uae30 \ub54c\ubb38\uc5d0 \ucd5c\ub300\uc218\ub97c \ubf51\ub294\uc218 \ubcf4\ub2e4n\ud06c\uac8c \uc124\uc815 \ud574 \uc8fc\uc2ed\uc2dc\uc624&#8221;);<br \/>\n\t\t\t} else {<br \/>\n\t\t\t\tta.setText(&#8220;\ucd94\ucca8\uc744 \uc2dc\uc791 \ud569\ub2c8\ub2e4&#8230;nn&#8221;);<br \/>\n\t\t\t\tif (cbSpeed.getState()) {<br \/>\n\t\t\t\t\tta<br \/>\n\t\t\t\t\t\t\t.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212; \uace0\uc18d\ubaa8\ub4dc &#8212;&#8212;&#8212;&#8212;&#8212;nn\uc218\ub97c \ubf51\ub294 \uc911\uac04\uacfc\uc815\uc744 \uc0dd\ub7b5 \ud558\uace0 \uacb0\uacfc\ub97c \ube68\ub9ac \ucd9c\ub825 \ud569\ub2c8\ub2e4.&#8221;);<br \/>\n\t\t\t\t\tlbResult.setText(&#8220;&#8221;);<br \/>\n\t\t\t\t} else {<br \/>\n\t\t\t\t\tta.append(&#8220;&#8212;&#8212;&#8212;&#8212;&#8212; \uc77c\ubc18\ubaa8\ub4dc &#8212;&#8212;&#8212;&#8212;&#8212;n&#8221;);<br \/>\n\t\t\t\t}<br \/>\n\t\t\t\tlong startTime = System.currentTimeMillis();<\/p>\n<p>\t\t\t\trl = new RandomLotto(Integer.parseInt(max.getText()), Integer<br \/>\n\t\t\t\t\t\t.parseInt(num.getText()));<br \/>\n\t\t\t\tString endStr = rl.getStringResult(rl.sort(rl<br \/>\n\t\t\t\t\t\t.strFilter(selectedNumbers.getText())));<\/p>\n<p>\t\t\t\tint[] statistics = new int[Integer.parseInt(num.getText())];<br \/>\n\t\t\t\tint progress = 0;<\/p>\n<p>\t\t\t\tfor (int i = 0; i &lt; Integer.parseInt(tfTry.getText()); i++) {<\/p>\n<p>\t\t\t\t\trl.lottery(cbBonus.getState());<\/p>\n<p>\t\t\t\t\tint grade = rl.getGrade(endStr);<\/p>\n<p>\t\t\t\t\tString strGrade = new String();<\/p>\n<p>\t\t\t\t\tif (grade &gt; Integer.parseInt(num.getText()) &#8211; 1) {<br \/>\n\t\t\t\t\t\t\/\/ strGrade =&#8221;\uaf5d&#8221;;<br \/>\n\t\t\t\t\t\tstatistics[statistics.length &#8211; 1]++;<br \/>\n\t\t\t\t\t} else {<br \/>\n\t\t\t\t\t\tstatistics[grade &#8211; 1]++;<br \/>\n\t\t\t\t\t\tstrGrade = grade + &#8220;\ub4f1&#8221;;<br \/>\n\t\t\t\t\t}<br \/>\n\t\t\t\t\tif (!cbSpeed.getState()) {<br \/>\n\t\t\t\t\t\tif (cbBonus.getState())<br \/>\n\t\t\t\t\t\t\tta<br \/>\n\t\t\t\t\t\t\t\t\t.append((i + 1)<br \/>\n\t\t\t\t\t\t\t\t\t\t\t+ &#8221; \ud68ct&#8221;<br \/>\n\t\t\t\t\t\t\t\t\t\t\t+ rl.getStringResult(rl.sort(rl<br \/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getStringResult()))<br \/>\n\t\t\t\t\t\t\t\t\t\t\t+ &#8221; (&#8221;<br \/>\n\t\t\t\t\t\t\t\t\t\t\t+ String.format(&#8220;%02d&#8221;, rl<br \/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getBonusNumber())<br \/>\n\t\t\t\t\t\t\t\t\t\t\t+ &#8220;)t&#8230;  &#8221; + strGrade + &#8220;n&#8221;);<br \/>\n\t\t\t\t\t\telse<br \/>\n\t\t\t\t\t\t\tta.append((i + 1)<br \/>\n\t\t\t\t\t\t\t\t\t+ &#8220;\ud68ct&#8221;<br \/>\n\t\t\t\t\t\t\t\t\t+ rl.getStringResult(rl.sort(rl<br \/>\n\t\t\t\t\t\t\t\t\t\t\t.getStringResult())) + &#8220;t&#8230;  &#8221;<br \/>\n\t\t\t\t\t\t\t\t\t+ strGrade + &#8220;n&#8221;);<\/p>\n<p>\t\t\t\t\t\tString lbStrResult = new String();<br \/>\n\t\t\t\t\t\tfor (int j = 0; j &lt; statistics.length &#8211; 1; j++) {<br \/>\n\t\t\t\t\t\t\tlbStrResult += (j + 1) + &#8220;\ub4f1 : &#8221; + statistics[j]<br \/>\n\t\t\t\t\t\t\t\t\t+ &#8221;       &#8220;;<br \/>\n\t\t\t\t\t\t}<br \/>\n\t\t\t\t\t\tlbStrResult += &#8220;\uaf5d : &#8221;<br \/>\n\t\t\t\t\t\t\t\t+ statistics[statistics.length &#8211; 1];<br \/>\n\t\t\t\t\t\tlbResult.setText(lbStrResult);<br \/>\n\t\t\t\t\t}<br \/>\n\t\t\t\t\tint temp = (int) (i<br \/>\n\t\t\t\t\t\t\t\/ (double) Integer.parseInt(tfTry.getText()) * 100) + 1;<br \/>\n\t\t\t\t\tif (progress != temp) {<br \/>\n\t\t\t\t\t\tprogress = temp;<br \/>\n\t\t\t\t\t\tlbResult2.setText(progress + &#8220;% \uc644\ub8cc&#8221;);<\/p>\n<p>\t\t\t\t\t}<br \/>\n\t\t\t\t}<\/p>\n<p>\t\t\t\tta.append(&#8220;n\uc785\ub825 \ud558\uc2e0 \ubc88\ud638 : &#8221; + selectedNumbers.getText() + &#8220;n&#8221;);<br \/>\n\t\t\t\tta.append(&#8220;\uc911\ubcf5\ub41c \uc22b\uc790, \ubc94\uc704\ub97c \ubc97\uc5b4\ub09c \uc22b\uc790\ub97c \ud544\ud130\ub9c1 \ud558\uc5ec \ub0a8\uc740 \ubc88\ud638 : &#8221;<br \/>\n\t\t\t\t\t\t+ rl.strFilter(selectedNumbers.getText()) + &#8220;n&#8221;);<br \/>\n\t\t\t\tta.append(&#8220;\uc22b\uc790\uac00 \ubd80\uc871\ud55c \uacbd\uc6b0 \ub79c\ub364\ud558\uac8c \ucc44\uc6b0\uace0 \ub118\uce58\ub294 \uacbd\uc6b0 \uc798\ub77c \ub0c5\ub2c8\ub2e4.n&#8221;);<\/p>\n<p>\t\t\t\tta.append(&#8220;n&#8212;&#8212;&#8212;&#8212;&#8212;- \uacb0  \uacfc &#8212;&#8212;&#8212;&#8212;&#8212;-n&#8221;);<br \/>\n\t\t\t\tta.append(&#8220;\ucd5c\uc885 \uc120\ud0dd\ub41c \ucd94\ucca8 \ubc88\ud638 : &#8221; + endStr + &#8220;nn&#8221;);<br \/>\n\t\t\t\tta.append(&#8221;   &#8211; \ub2f9\ucca8 \ud69f\uc218 &#8211; n&#8221;);<br \/>\n\t\t\t\tString lbStrResult = new String();<br \/>\n\t\t\t\tfor (int j = 0; j &lt; statistics.length &#8211; 1; j++) {<br \/>\n\t\t\t\t\tlbStrResult += String.valueOf(j + 1)<br \/>\n\t\t\t\t\t\t\t+ &#8220;\ub4f1t&#8221;<br \/>\n\t\t\t\t\t\t\t+ statistics[j]<br \/>\n\t\t\t\t\t\t\t+ &#8220;\ud68ct(&#8221;<br \/>\n\t\t\t\t\t\t\t+ String.format(&#8220;%08.5f&#8221;, (statistics[j]<br \/>\n\t\t\t\t\t\t\t\t\t\/ (double) Integer<br \/>\n\t\t\t\t\t\t\t\t\t\t\t.parseInt(tfTry.getText()) * 100))<br \/>\n\t\t\t\t\t\t\t+ &#8220;%)n&#8221;;<br \/>\n\t\t\t\t}<br \/>\n\t\t\t\tlbStrResult += &#8221; \uaf5dt&#8221;<br \/>\n\t\t\t\t\t\t+ statistics[statistics.length &#8211; 1]<br \/>\n\t\t\t\t\t\t+ &#8220;\ud68ct(&#8221;<br \/>\n\t\t\t\t\t\t+ String.format(&#8220;%08.5f&#8221;,<br \/>\n\t\t\t\t\t\t\t\t(statistics[statistics.length &#8211; 1]<br \/>\n\t\t\t\t\t\t\t\t\t\t\/ (double) Integer.parseInt(tfTry<br \/>\n\t\t\t\t\t\t\t\t\t\t\t\t.getText()) * 100)) + &#8220;%)n&#8221;;<br \/>\n\t\t\t\tta.append(lbStrResult);<\/p>\n<p>\t\t\t\tlong endTime = System.currentTimeMillis();<br \/>\n\t\t\t\tta.append(&#8220;n\uc218\ud589 \uc2dc\uac04 : &#8221; + (endTime &#8211; startTime) \/ (double) 1000<br \/>\n\t\t\t\t\t\t+ &#8220;\ucd08n&#8221;);<br \/>\n\t\t\t\tta.append(&#8220;\uc608\uc0c1 1\ub4f1 \ub2f9\ucca8 \ud655\ub960 : &#8221;<br \/>\n\t\t\t\t\t\t+ String.format(&#8220;%17.15f&#8221;, rl.proba() * 100) + &#8220;%n&#8221;+ &#8220;(\uc608\uc0c1\ud655\ub960\uc758 100\ubc30\uc774\uc0c1\uc758 \ud69f\uc218\ub85c \uc2dc\ub3c4 \ud588\uc744\ub54c \uc2e0\ub8b0)&#8221;);<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t}<br \/>\n}<br \/>\n<span id=tx_marker_caret><\/span><\/textarea><br \/>\n_M#]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc790\ubc14\uac00 \uc124\uce58 \ub418\uc5b4 \uc788\uc5b4\uc57c \uc815\uc0c1\uc801\uc73c\ub85c \ubcf4\uc778\ub2e4. \ubcf4\uc774\uc9c0 \uc54a\uc73c\uba74 \uc544\ub798\uc758 \ub9c1\ud06c\ub85c \ub2e4\uc6b4 \ubc1b\ub294\ub2e4. Lotto Simulator \ub294 \ub85c\ub610 \ubcf5\uad8c\uc744 \uac00\uc0c1\uc73c\ub85c \ucd94\ucca8 \ud574 \ubcfc\uc218 \uc788\ub294 \ud504\ub85c\uadf8\ub7a8\uc774\ub2e4. \uae30\ubcf8\uc801\uc778 \uc124\uc815\uc740 \uc624\ub9ac\uc9c0\ub110 \ub85c\ub610 \ubcf5\uad8c \uc14b\ud305 ( 6 \/ 45 + \ubcf4\ub108\uc2a4 ) \ub85c \ub418\uc5b4 \uc788\uace0 \uc0ac\uc6a9\uc790\uac00 \uc6d0\ud558\ub294 \uac12\uc73c\ub85c \ubcc0\uacbd\ub3c4 \uac00\ub2a5. \ub9cc\uc57d \ubc94\uc704\ub97c \ubc97\uc5b4\ub09c \uac12\uc744 \ub123\uac70\ub098 \uc124\uc815\ud55c \uac2f\uc218\uc5d0 \ucd08\uacfc \ub610\ub294 \ubbf8\ub2ec \ud558\uba74 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[21],"tags":[52,149,170,230,231,299,313,323,381,382,387,417,475],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pXV5a-zY","_links":{"self":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts\/2230"}],"collection":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2230"}],"version-history":[{"count":0,"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts\/2230\/revisions"}],"wp:attachment":[{"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}