Red de conocimiento informático - Material del sitio web - Problemas en el algoritmo de Dayan

Problemas en el algoritmo de Dayan

lt;htmlgt;

lt;headgt;

lt;titlegt; prueba de Javascript del algoritmo Zhouyi Dayanlt;/titlegt;

lt;script language= "javascript "gt;

función getValue(a){

var dyValue, tianValue, diValue, tianTValue, diTValue, renValue, randnum, tempValue, resultValue;

dyValue =55;

renValue=1;

for (j=0;jlt;6;j){

tempValue=dyValue-6;

for (i=0;ilt;3;i){

tianValue= Math.floor(Math.random()*(tempValue-1));

diValue=tempValue-tianValue;

diValue=diValue-renValue;

//alert(" tempValue:" tempValue "\ntianValue: " tianValue "\ndiValue: " diValue);

tianTValue=(tianValue4==0)?4:tianValue4;

diTValue=(diValue4==0)?4:diValue4;

resultValue= tianTValue diTValue renValue;

//alert(resultValue);

eval(" document.formname.text " (j 1) (i 1)).value=resultValue;

p>

tempValue=tempValue-resultValue;

if (i==2)

inputValue(j 1);

}

}

function inputValue(num){

var num1, num2, num3

num1=eval("document.formname.text " num; "1 ").valor;

num2=eval("document.formname.text " num "2").valor;

num3=eval("document.formname.text " num "3").value;

allnum=checkValue(num1) checkValue(num2) checkValue(num3);

//alert("num1: " num1 "/num2 :" num2 "/num3: " num3);

// alert("num1: " checkValue(num1) "/num2: " checkValue(num2) "/num3:" checkValue(num3)

));

//alert(allnum);

if (allnumgt; 1 )

{

eval("document. formname.a " num).value="━";

if (allnum==3)

eval("document.formname.b " num).value="┅ ";

else

eval("document.formname.b " num).value="━";

}

else

{

eval("document.formname.a " num).value=" ┅";

if (allnum==0)

eval("document.formname.a " num).value=" ┅";

if (allnum==0)

if (allnum==0 )

eval("document.formname.b " num).value=" ┅";