final1.jpg

-------------------------------------------------------------
 

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • May 20 Fri 2016 14:35
  • XAXB

rnd.jpg

-------------------------------------------------
<html>



<head><script language="JavaScript">

<!--

var all_times;

var win_times;

var answer;

var talk;

var times;

var ExpDate = new Date();

ExpDate.setTime(ExpDate.getTime() + (24*60*60*30*1000));



//Cookie

function GetCookie(name) {

  var arg = name + "=";

  var alen = arg.length;

  var clen = document.cookie.length;

  var i = 0;

  while (i < clen) {

      var j = i + alen;

      if (document.cookie.substring(i, j) == arg)

        return getCookieVal (j);

      i = document.cookie.indexOf(" ", i) + 1;

      if (i == 0)

        break;

  }

  return null;

}



function SetCookie (name, value) {

   var argv = SetCookie.arguments;

   var argc = SetCookie.arguments.length;

   var expires = (argc > 2) ? argv[2] : null;

   var path = (argc > 3) ? argv[3] : null;

   var domain = (argc > 4) ? argv[4] : null;

   var secure = (argc > 5) ? argv[5] : false;

   document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires="

                              + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path))

                              + ((domain == null) ? "" : ("; domain=" + domain))

                              + ((secure == true) ? "; secure" : "");

}



function getCookieVal (offset) {

   var endstr = document.cookie.indexOf (";", offset);

   if (endstr == -1)

      endstr = document.cookie.length;

   return unescape(document.cookie.substring(offset, endstr));

}

//end Cookie



all_times = GetCookie("alltimes");

win_times = GetCookie("wintimes");

if(all_times == null)

{

  win_times=all_times=0;

  SetCookie("wintimes",win_times,ExpDate);

  SetCookie("alltimes",all_times,ExpDate);

}



function restart()

{

  clear();

  answer="";

  talk="";

  times=0;

  var a1 = Math.floor(Math.random()*10);

  var a2 = Math.floor(Math.random()*10);

  var a3 = Math.floor(Math.random()*10);

  var a4 = Math.floor(Math.random()*10);



  while(a2==a1)

  a2 = Math.floor(Math.random()*10);

  while((a3==a1)||(a3==a2))

  a3 = Math.floor(Math.random()*10);

  while((a4==a1)||(a4==a2)||(a4==a3))

  a4 = Math.floor(Math.random()*10);

  answer = a1+""+a2+""+a3+""+a4;

}



function right(form)

{

  var guessstring = form.guess.value;

  var anum=0;

  var bnum=0;



  for(i=0;i<4;i++)

  {

     if(answer.substring(i,i+1)==guessstring.substring(i,i+1))

       anum++;

     else

     {

       for(j=0;j<4;j++)

       {

          if(j!=i)

          {

            if(answer.substring(j,j+1)==guessstring.substring(i,i+1))

              bnum++;

          }

       }

     }

  }

  times++;

  if(anum==4)

  {

    alert("猜了第"+times+"次就答對了!!");

    win_times++;

    all_times++;

    SetCookie("wintimes",win_times,ExpDate);

    SetCookie("alltimes",all_times,ExpDate);

    if(confirm("不錯嗎!再來一局吧??"))

      restart();

    else

      window.close();

  }

  else

  {

      if(times==20)

      {

         alert("Game Over!!猜數字的次數已超過20次!!");

         all_times++;

         SetCookie("alltimes",all_times,ExpDate);

         if(confirm("別灰心!再來一局吧??"))

            restart();

         else

            window.close();

      }

      else

      {

         talk=talk+"\n"+guessstring+"  "+anum+"A"+bnum+"B";

         alert(talk+"\n這是您第"+times+"次所猜的數字!");

         clear();

      }

   }

}



function check(form)

{

  var guessstring=form.guess.value;

  if(guessstring.length==4)

  {

     if((guessstring.substring(0,1)==guessstring.substring(1,2))||

         (guessstring.substring(0,1)==guessstring.substring(2,3))||

         (guessstring.substring(0,1)==guessstring.substring(3,4))||

         (guessstring.substring(1,2)==guessstring.substring(2,3))||

         (guessstring.substring(1,2)==guessstring.substring(3,4))||

         (guessstring.substring(2,3)==guessstring.substring(3,4)))

     {

       alert("錯誤!!請輸入4位不同的數字!!");

       clear();

     }

     else

       right(form);

  }

  else

  {

    alert("錯誤!!請輸入4位不同的數字!!");

    clear();

  }

}



function clear()

{

  document.game.guess.value="";

  document.game.guess.focus();

}



function record()

{

  var rec1;

  var rec2=all_times-win_times;

  if(all_times==0)

    rec1=0;

  else

    rec1=Math.round(win_times/all_times*100);

  alert("目前你(妳)的戰績為 "+win_times+"勝"+rec2+"敗\n"+

          "勝率為 "+rec1+"% !!");

  clear();

}



function clearrecord()

{

  if(confirm("確定要清除紀錄??"))

  {

    win_times=all_times=0;

    SetCookie("wintimes",win_times,ExpDate);

    SetCookie("alltimes",all_times,ExpDate);

  }

}





//-->

</script>



<title>1A2B Java Script</title>

</head>



<body



<p align="center"><big>1A2B</big></big></font></p>



<form name="game" onSubmit="check(this);return false;">



  <div align="center"><center><p><input type="text" size="8" name="guess"> <input type="button" value="送出" onClick="check(this.form)"> <input type="button" value="查看已猜數字!" onClick="alert(talk+'\n這是你(妳)'+times+'次所猜的數字!')"> </p>



  </center></div><hr>

<div align="center"><center><p><input type="button" value="遊戲開始" onClick="restart()">

  </center></div>

</form>





</body>

</html>

lasmilou 發表在 痞客邦 留言(0) 人氣()

cyc.jpg

 
------------------------------------------------------------

lasmilou 發表在 痞客邦 留言(0) 人氣()

L.jpg

---------------------------------------------------------------------------------------------
<html>

  <head>

    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

    <script type="text/javascript">

      google.charts.load('current', {'packages':['corechart']});

      google.charts.setOnLoadCallback(drawChart);

     var a=0;

     var b=0;

     var c=0;

      function check1() {



      var radio1=document.getElementsByName("v1");

var radio2=document.getElementsByName("v2");

var radio3=document.getElementsByName("v3");

var radio4=document.getElementsByName("v4");

var radio5=document.getElementsByName("v5");

var radio6=document.getElementsByName("v6");

var radio7=document.getElementsByName("v7");

var radio8=document.getElementsByName("v8");

var radio9=document.getElementsByName("v9");

var radio10=document.getElementsByName("v10");

   for(var i=0;i<radio1.length;i++)  {

         if(radio1.item(i).checked==true) {

          flag1=1+i;

      if (flag1==1){a=a+1;}

      else if(flag1==2){b=b+1;}

      else{c=c+1;}

                            break;

     }

     



}

   for(var i=0;i<radio1.length;i++)  {

         if(radio2.item(i).checked==true) {

          flag2=1+i;

        

      if (flag2==1){a=a+1;}

else if(flag2==2){b=b+1;}

else {c=c+1;}

                  break;

     }



}

for(var i=0;i<radio1.length;i++)  {

         if(radio3.item(i).checked==true) {

          flag3=1+i;

               if (flag3==1){a=a+1;}

else if(flag3==2){b=b+1;}

else {c=c+1;}

                  break;

     }



}

for(var i=0;i<radio1.length;i++)  {

         if(radio4.item(i).checked==true) {

          flag4=1+i;

               if (flag4==1){a=a+1;}

else if(flag4==2){b=b+1;}

else {c=c+1;}

                  break;

     }



}

for(var i=0;i<radio1.length;i++)  {

         if(radio5.item(i).checked==true) {

          flag5=1+i;

        

      if (flag5==1){a=a+1;}

else if(flag5==2){b=b+1;}

else {c=c+1;}

                  break;

     }

}

for(var i=0;i<radio1.length;i++)  {

         if(radio6.item(i).checked==true) {

          flag6=1+i;

         if (flag6==1){a=a+1;}

else if(flag6==2){b=b+1;}

else {c=c+1;}

                  break;

     }

     

}

for(var i=0;i<radio1.length;i++)  {

         if(radio7.item(i).checked==true) {

          flag7=1+i;

               if (flag7==1){a=a+1;}

else if(flag7==2){b=b+1;}

else {c=c+1;}

                  break;

     }



}

for(var i=0;i<radio1.length;i++)  {

         if(radio8.item(i).checked==true) {

          flag8=1+i;

          if (flag8==1){a=a+1;}

else if(flag8==2){b=b+1;}

else {c=c+1;}

                  break;

     }

    

}

for(var i=0;i<radio1.length;i++)  {

         if(radio9.item(i).checked==true) {

          flag9=1+i;

         if (flag9==1){a=a+1;}

else if(flag9==2){b=b+1;}

else {c=c+1;}

                  break;

     }

     

}

for(var i=0;i<radio1.length;i++)  {

         if(radio10.item(i).checked==true) {

          flag10=1+i;

         if (flag10==1){a=a+1;}

else if(flag10==2){b=b+1;}

else {c=c+1;}

                  break;

     }

     

      }







       drawChart() ;

}

      function drawChart() {







        var data = google.visualization.arrayToDataTable([

          ['Task', 'Hours per Day'],

          ['1',     a],

          ['2',     b],

          ['3',     c],

         

        ]);



        var options = {

          title: 'My Daily Activities'

        };



        var chart = new google.visualization.PieChart(document.getElementById('piechart'));



        chart.draw(data, options);

      }

    </script>

  </head>

  <body>



<h1>1、ssss?</h1>

<input name="v1" type="radio" value="300年">300年           

<input name="v1" type="radio" value="400年">400年             

<input name="v1" type="radio" value="1000年">1000年





<h1>2、ssss?</h1>

<input name="v2" type="radio" value="300年">300年           

<input name="v2" type="radio" value="400年">400年             

<input name="v2" type="radio" value="1000年">1000年



<h1>3、ssss?</h1>

<input name="v3" type="radio" value="300年">300年           

<input name="v3" type="radio" value="400年">400年             

<input name="v3" type="radio" value="1000年">1000年



<h1>4、ssss?</h1>

<input name="v4" type="radio" value="300年">300年           

<input name="v4" type="radio" value="400年">400年             

<input name="v4" type="radio" value="1000年">1000年



<h1>5、ssss?</h1>

<input name="v5" type="radio" value="300年">300年           

<input name="v5" type="radio" value="400年">400年             

<input name="v5" type="radio" value="1000年">1000年



<h1>6、ssss?</h1>

<input name="v6" type="radio" value="300年">300年           

<input name="v6" type="radio" value="400年">400年             

<input name="v6" type="radio" value="1000年">1000年



<h1>7、ssss?</h1>

<input name="v7" type="radio" value="300年">300年           

<input name="v7" type="radio" value="400年">400年             

<input name="v7" type="radio" value="1000年">1000年



<h1>8、ssss?</h1>

<input name="v8" type="radio" value="300年">300年           

<input name="v8" type="radio" value="400年">400年             

<input name="v8" type="radio" value="1000年">1000年



<h1>9、ssss?</h1>

<input name="v9" type="radio" value="300年">300年           

<input name="v9" type="radio" value="400年">400年             

<input name="v9" type="radio" value="1000年">1000年



<h1>10、ssss?</h1>

<input name="v10" type="radio" value="300年">300年           

<input name="v10" type="radio" value="400年">400年             

<input name="v10" type="radio" value="1000年">1000年



 <input type="button" value="submit" onclick="check1() " />



    <div id="piechart" style="width: 900px; height: 500px;"></div>

  </form>

  </body>

</html>

lasmilou 發表在 痞客邦 留言(0) 人氣()

Image 12.jpg

-------------------------------------------------
<html>
<head>
     <title>
             Form
     </title>
<script>
function check1() {
var radio1=document.getElementsByName("v1");
  var radio2=document.getElementsByName("v2");
var radio3=document.getElementsByName("v3");
var radio4=document.getElementsByName("v4");
var radio5=document.getElementsByName("v5");
var radio6=document.getElementsByName("v6");
var radio7=document.getElementsByName("v7");
var radio8=document.getElementsByName("v8");
var radio9=document.getElementsByName("v9");
var radio10=document.getElementsByName("v10");
   for(var i=0;i<radio1.length;i++)  {
         if(radio1.item(i).checked==true) {
          flag1=1+i;
                      
    for(var i=0;i<radio2.length;i++) 
         if(radio2.item(i).checked==true)
          flag2=1+i;
for(var i=0;i<radio3.length;i++) 
         if(radio3.item(i).checked==true)
          flag3=1+i;
for(var i=0;i<radio4.length;i++) 
         if(radio4.item(i).checked==true)
          flag4=1+i;
for(var i=0;i<radio5.length;i++) 
         if(radio5.item(i).checked==true)
          flag5=1+i;
for(var i=0;i<radio6.length;i++) 
         if(radio6.item(i).checked==true)
          flag6=1+i;
for(var i=0;i<radio7.length;i++) 
         if(radio7.item(i).checked==true)
          flag7=1+i;
for(var i=0;i<radio8.length;i++) 
         if(radio8.item(i).checked==true)
          flag8=1+i;
for(var i=0;i<radio9.length;i++) 
         if(radio9.item(i).checked==true)
          flag9=1+i;
for(var i=0;i<radio10.length;i++) 
         if(radio10.item(i).checked==true)
          flag10=1+i;     
                  break;
     }
}
x=flag1+flag2+flag3+flag4+flag5+flag6+flag7+flag8+flag9+flag10
 document.write(flag1,flag2,flag3,flag4,flag5,flag6,flag7,flag8,flag9,flag10,x);
  }
</script>
</head>
<body>
<form action="post.php" method="post"  name="add" enctype="multipart/form-data" onSubmit="return check();" >
<h1>1、ssss?</h1>
<input name="v1" type="radio" value="300年">300年           
<input name="v1" type="radio" value="400年">400年             
<input name="v1" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v2" type="radio" value="300年">300年           
<input name="v2" type="radio" value="400年">400年             
<input name="v2" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v3" type="radio" value="300年">300年           
<input name="v3" type="radio" value="400年">400年             
<input name="v3" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v4" type="radio" value="300年">300年           
<input name="v4" type="radio" value="400年">400年             
<input name="v4" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v5" type="radio" value="300年">300年           
<input name="v5" type="radio" value="400年">400年             
<input name="v5" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v6" type="radio" value="300年">300年           
<input name="v6" type="radio" value="400年">400年             
<input name="v6" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v7" type="radio" value="300年">300年           
<input name="v7" type="radio" value="400年">400年             
<input name="v7" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v8" type="radio" value="300年">300年           
<input name="v8" type="radio" value="400年">400年             
<input name="v8" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v9" type="radio" value="300年">300年           
<input name="v9" type="radio" value="400年">400年             
<input name="v9" type="radio" value="1000年">1000年
<h1>1、ssss?</h1>
<input name="v10" type="radio" value="300年">300年           
<input name="v10" type="radio" value="400年">400年             
<input name="v10" type="radio" value="1000年">1000年
<input type="button" value="submit" onclick="check1()" />
</form>
</body>
</html>

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Apr 28 Thu 2016 13:00
  • 問卷

Image 15.jpg

-------------------------------------------------------------------------
<form action="#" method="post" class="demoForm" id="demoForm">

    <fieldset>

        <legend>Demo: Get Value of Selected</legend>

  

    <p>Select a shipping method:</p>

    <p>

        <label><input type="radio" name="ship" value="a" checked /> a:Standard Ground</label>

        <label><input type="radio" name="ship" value="b" /> b:Second Day</label>

        <label><input type="radio" name="ship" value="c" /> c:Overnight</label>

        <label><input type="radio" name="ship" value="d" /> d:Pick up</label>

    </p>

  

    <p><button type="button" name="getVal">Get Value of Selected</button></p>

  

    </fieldset>

</form>

<script type="text/javascript">

// to remove from global namespace

(function() {

  

    function getRadioVal(form, name) {

        var val;

        var radios = form.elements[name];

      

        for (var i=0, len=radios.length; i<len; i++) {

            if ( radios[i].checked ) {

                val = radios[i].value;

                break;

            }

        }

        return val;

    }





    document.forms['demoForm'].elements['getVal'].onclick = function() {

        alert( 'The selected radio button\'s value is: ' + getRadioVal(this.form, 'ship') );

    };

  

  

    // disable submission of all forms on this page

    for (var i=0, len=document.forms.length; i<len; i++) {

        document.forms[i].onsubmit = function() { return false; };

    }

  

}());



</script>

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Apr 22 Fri 2016 15:29
  • JAVA6

未命名.jpg
 
 

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Feb 19 Fri 2016 15:58
  • JAVA1

1460705782-4230406409.jpg

 
 

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Dec 18 Fri 2015 16:38
  • C#N

C#N.jpg
 

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Nov 06 Fri 2015 16:12
  • C#6

C%236.jpg
 

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Oct 30 Fri 2015 15:54
  • C#5

C#3.jpg
 

lasmilou 發表在 痞客邦 留言(0) 人氣()

  • Oct 23 Fri 2015 15:54
  • C#4


C#4.jpg 




-------------------------------------------------------------


namespace WindowsFormsApplication3

{

    public partial class Form1 : Form

    {

        int rndmoney1 = 0, rndmoney2 = 0, rndmoney3=0;

        public Form1()

        {

            InitializeComponent();

        }



        private void Form1_Load(object sender, EventArgs e)

        {



        }

        private void button4_Click(object sender, EventArgs e)

        {

            Random rnd = new Random();

            rndmoney1 = rnd.Next(0, 9); // creates a number between 1 and 9

            button1.Text = rndmoney1.ToString();

            rndmoney2 = rnd.Next(0, 9); // creates a number between 1 and 9

            button2.Text = rndmoney2.ToString();

            rndmoney3 = rnd.Next(0, 9); // creates a number between 1 and 9

            button3.Text = rndmoney3.ToString();

        }

    }

}

lasmilou 發表在 痞客邦 留言(0) 人氣()

1 2
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。