Javascript - Html kodları

Aşağıdaki kodları <body> kodundan sonra istediğiniz bir yere yapıştırın.

{codecitation class="brush: xml; gutter: false;" width="500px"}
<script language="JavaScript"><!--

// Hide the script from old browsers --

function MakeArray(n) {

this.length=n;

for (var i=1; i<=n;i++){

this[i]=0 }

return this

}

var num =new MakeArray(6)

var win=new MakeArray(6)

var str=""

count=0

var res=" "

var match=0

function rand()

{

var now=new Date()

var seed = -(now.getTime())

var arr=new MakeArray(97)

m1=259200; a1=7141;c1=54773;

r1=3.8580247e-6

m2=134456;a2=8121;c2=28411

r2=7.4373773e-6

m3=243000;a3=4561;c3=51349

if (seed<0)

{

x1=(c1-seed)%m1

x1=(a1*x1+c1)%m1

x2=x1%m3

x1=(a1*x1+c1)%m1

x3=x1%m3

for (j=0;j<97;j++) {

x1=(a1*x1+c1)%m1

x2=(a2*x2+c2)%m2

arr[j]=(x1+x2*r2)*r1

}

seed=1

}

x1=(a1*x1+c1)%m1

x2=(a2*x2+c2)%m2

x3=(a3*x3+c3)%m3

j=Math.floor((97*x3)/m3)

var ran1=arr[j]

arr[j]=(x1+x2*r2)*m1

return ran1

}

function selnum(form,c) {

if (count==0){

for(i=0;i<6;i++){num[i]=0}}

num[count]=c

str += num[count]+" "

document.inform.choice.value=str

count++



if (count>=6){

count=0;

str=""

checkset()}

}

function checkset(){

var i=""

for(i =0;i<49;i++){

if (document.inform[i].checked==true) {

document.inform[i].checked=false }

}}

function lottery(form) {

for(i=0;i<6;i++) {win[i]=0 }

win[0]=Math.ceil(rand()*49)

for(i=1;i<6;i++){

win[i]=Math.ceil(rand()*49)

for ( k=i-1;k>=0; k--) {

if ( win[i]==win[k] ) {

i -=1 }

}}

numsort()

}

function numsort(){

for (i=0;i<6;i++) {

for (k=0;k<6;k++) {

if (win[i]<win[k]) {

temp=win[k]

win[k] = win[i]

win[i] = temp }

}}

matchnum()

}

function matchnum(){

for (i=1;i<=6;i++) {

res+= win[i-1]+" "

}

document.inform.result.value= res

match=0

res=""

for(i=0;i<6;i++) {

for(k=0;k<6;k++) {

if (win[i]==num[k]){

match++

break}

}}

document.inform.total.value = " Uyumlu numaralarınızın sayısı: "+match+" "



}

// --End Hiding Here

// --></script> </p>



<form name="inform">

<div align="center"><center><table border="1" cellpadding="0"

cellspacing="0" bordercolor="#808080">

<tr>

<td>&nbsp;</td>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,1)">1 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,2)">2 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,3)">3 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,4)">4 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,5)">5 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,6)">6 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,7)">7 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,8)">8 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,9)">9 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,10)">10 </font></th>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,11)">11 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,12)">12 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,13)">13 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,14)">14 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,15)">15 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,16)">16 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,17)">17 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,18)">18 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,19)">19 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,20)">20 </font></th>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,21)">21 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,22)">22 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,23)">23 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,24)">24 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,25)">25 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,26)">26 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,27)">27 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,28)">28 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,29)">29 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,30)">30 </font></th>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,31)">31 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,32)">32 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,33)">33 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,34)">34 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,35)">35 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,36)">36 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,37)">37 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,38)">38 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,39)">39 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,40)">40 </font></th>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,41)">41 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,42)">42 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,43)">43 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,44)">44 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,45)">45 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,46)">46 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,47)">47 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,48)">48 </font></th>

<th align="left"><font face="Verdana"><input

type="checkbox" onclick="selnum(this.form,49)">49 </font></th>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left" colspan="6"><font face="Verdana">Favori

Rakamlarınız(seçiminiz)</font></th>

<td colspan="4"><font face="Verdana"><input

type="text" size="18" name="choice"> </font></td>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left" colspan="10"><font face="Verdana"><input

type="button" value=" Başlat "

onclick="lottery(this.form)"> </font></th>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left" colspan="6"><font face="Verdana">Çekiliş

Sonucu </font></th>

<td colspan="4"><font face="Verdana"><input

type="text" size="18" name="result"> </font></td>

</tr>

<tr>

<td>&nbsp;</td>

<th align="left" colspan="10"><font face="Verdana"><input

type="text" size="40" name="total"> </font></th>

</tr>

</table>

</center></div>

</form>


{/codecitation}



Örnek demo için tıklayın >>