Wed

18

Mar

2009

40、脑筋急转弯4

40、脑筋急转弯4

<html>

<head><STYLE type=text/css>.t9pt {

       FONT-SIZE: 9pt

}

A {

       COLOR: black; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: none

}

A:hover {BACKGROUND:#ffffff;font-style:normal;text-decoration:none;font-size:9pt;color:red

}

A:active {

       COLOR: #00ccff; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: underline

}

TABLE {

       FONT-SIZE: 9pt

}

</STYLE>

<title>星幻-IQ自测</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="JavaScript">

<!--

function MM_popupMsg(msg) { //v1.0

  alert(msg);

}

//-->

</script>

</head>

 

<body bgcolor="#FFFFFF" text="#000000" >

<hr> 

<div align="center">

  <center>

    <table width="100%" border=0 height="257">

      <tbody>

      <tr>

        <td width="81%" height=109>

          <form>

            <table bordercolor=#000000 cellspacing=0 cellpadding=0 width="100%"

            border=0>

              <tbody>

              <tr>

                <td width="96%" height="40"> 小明的母亲有三个儿子,大儿子叫大毛,二儿子叫二毛,三儿子叫什么?</td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:小明')" type=button value=答案 name=button>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 有一种东西,买的人知道,卖的人也知道,只有用的人不知道,是什么东西?

                  <br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案是:棺材')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 狐狸精最擅长迷惑男人,那么什么""男女一起迷? <br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:酒精')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 小明带100元去买一件75元的东西,但老板却只找了5块钱给他,为什么?

                  <br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案: 他给老板80\r')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 一辆出租车在公路上正常行驶,并且没有违反任何交通规则却被一个警察给拦住了,请问为什么?

                  <br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:警察想做出租车')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 有一个小圆孔的直径只有1厘米,而有一种体积达100立方米的物体却能顺利通过这个不孔,那么它是什么物体呢?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:水')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 大勇说他和学校的老师很熟,在学校里哪里都能进去,但小涵偏说他有一处地方永远也不能进去,是什么地方呢?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:换一辆大点的车')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 什么地方恶人们不再干扰得你心烦意乱,而只好与你生活在一起?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案: 天堂')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 什么东西将一间屋子装满,人又能活动自如?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:空气和光\r')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 幼儿园放学了,但却没有一个小朋友从大门出去,是怎么回事呢?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:大门正在检修,请走侧门')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 超人和蝙蝠侠的最大区别是什么?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('蝙蝠侠把内裤穿在里面,超人把内裤穿在外面')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="96%" height="40"> 有一种棋只有两种棋子,你知道是什么棋类吗?<br>

                </td>

                <td width="4%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:围棋,只有两种黑白棋子。')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              </tbody>

            </table>

          </form>

        </td>

      </tr>

      </tbody>

    </table>

   

  </center>

</div>

<hr>

</body>   

</html>   

 

 

0 Comments

Wed

18

Mar

2009

39、脑筋急转弯3

39、脑筋急转弯3

<html>

<head><STYLE type=text/css>.t9pt {

       FONT-SIZE: 9pt

}

A {

       COLOR: black; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: none

}

A:hover {BACKGROUND:#ffffff;font-style:normal;text-decoration:none;font-size:9pt;color:red

}

A:active {

       COLOR: #00ccff; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: underline

}

TABLE {

       FONT-SIZE: 9pt

}

</STYLE>

<title>星幻-IQ自测</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="JavaScript">

<!--

function MM_popupMsg(msg) { //v1.0

  alert(msg);

}

//-->

</script>

</head>

 

<body bgcolor="#FFFFFF" text="#000000" >

<hr> 

<div align="center">

  <center>

    <table width="100%" border=0>

      <tbody>

      <tr>

        <td width="81%" height=57>

          <form>

            <table bordercolor=#000000 cellspacing=0 cellpadding=0 width="100%"

            border=0>

              <tbody>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 盆里有6只馒头,6个小朋友每人分到1只,但盆里还留着1只,为什么?

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:一个小朋友连馒头和盆一起拿走')" type=button value=答案 name=button \r?)>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 你能以最快速度,把冰变成水吗?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:将“冰”字的两点水去掉')" type=button value=答案 name=button2 \r?)>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 冬天,宝宝怕冷,到了屋里也不肯脱帽。可是他见了一个人乖乖地脱下帽,那人是谁?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:理发师')" type=button value=答案 name=button2 ?)>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 鸡蛋壳有什么用处?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:用来包蛋清和蛋黄')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 什么事每人每天都必须认真的做? <br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:睡觉\r\r')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 什么人始终不敢洗澡 <br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:泥人')" type=button value=答案 name=Button>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height=40> 什么车子寸步难行?<br>

                </td>

                <td width="6%" height=40>

                  <div align=right>

                    <input onClick="MM_popupMsg('答案是:风车')" type=button value=答案 name=Button>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 哪一个月有二十八天?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:每个月都有28 ')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 什么蛋打不烂,煮不熟,更不能吃?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:考试得的零蛋\"0\" ')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 火车由北京到上海需要6小时,行使3小时后,火车该在什么地方?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:在车轨上 ')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr align="left" valign="middle">

                <td width="94%" height="40"> 时钟什么时候不会走?<br>

                </td>

                <td width="6%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:时钟本来就不会走')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              </tbody>

            </table>

          </form>

        </td>

      </tr>

      </tbody>

    </table>

   

  </center>

</div>

<hr>

</body>   

</html>  

0 Comments

Wed

18

Mar

2009

38、脑筋急转弯行2

38、脑筋急转弯行2

<html>

<head><STYLE type=text/css>.t9pt {

       FONT-SIZE: 9pt

}

A {

       COLOR: black; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: none

}

A:hover {BACKGROUND:#ffffff;font-style:normal;text-decoration:none;font-size:9pt;color:red

}

A:active {

       COLOR: #00ccff; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: underline

}

TABLE {

       FONT-SIZE: 9pt

}

</STYLE>

<title>星幻-IQ自测</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="JavaScript">

<!--

function MM_popupMsg(msg) { //v1.0

  alert(msg);

}

//-->

</script>

</head>

 

<body bgcolor="#FFFFFF" text="#000000" >

<hr> 

<div align="center">

  <center>

    <table width="100%" border=0 height="146" align="center">

      <tbody>

      <tr>

        <td width="81%" height=302>

          <form>

            <table bordercolor=#000000 cellspacing=0 cellpadding=0 width="100%"

            border=0>

              <tbody>

              <tr>

                <td width="99%" height="40"> 一只鸡,一只鹅,放冰箱里,鸡冻死了,鹅却活着,为什么?</td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:企鹅')" type=button value=答案 name=button3>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 用什么方法立刻可以找到遗失的图钉?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:光着脚走\r')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 农夫养10头牛,只有19只角,为什么?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:有一头是犀牛')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 用什么擦地最干净?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:用力\r')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 一个人想在一夜里变成百万富翁,他该怎么办?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:做梦吧')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 一只狗总也不洗澡,为什么不生虱子?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:狗只会生小狗\r\r')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 什么鸡没有翅膀?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:田鸡\r')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 有一个穿着泳装的女人,她在松软的沙滩上漫步,这一切虽然都很正常,但是,你会发现她的身后竟然没有脚印!这是为什么?请你猜猜看。

                  <br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:倒着走')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 吃苹果时,咬了一口发现有一条虫子,觉得特别恶心;看到两条虫子,觉得更恶心;请问:看到几条虫子让人最恶心?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:半条虫子')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 打什么东西既不花力气又舒服</td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:打瞌睡')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 邻居老李家的屋顶为什么有时漏雨,有时不漏雨<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:下雨漏,不下雨不漏')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="99%" height="40"> 中国的内地生产什么?<br>

                </td>

                <td width="1%" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('答案:玉(国字里是玉)')" type=button value=答案 name=button22>

                  </div>

                </td>

              </tr>

              </tbody>

            </table>

          </form>

        </td>

      </tr>

      </tbody>

    </table>

   

  </center>

</div>

<hr>

</body>   

</html>   

 

 

1 Comments

Wed

18

Mar

2009

37、脑筋急转弯1

37、脑筋急转弯1

<html>

<head><STYLE type=text/css>.t9pt {

       FONT-SIZE: 9pt

}

A {

       COLOR: black; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: none

}

A:hover {BACKGROUND:#ffffff;font-style:normal;text-decoration:none;font-size:9pt;color:red

}

A:active {

       COLOR: #00ccff; FONT-SIZE: 9pt; FONT-STYLE: normal; TEXT-DECORATION: underline

}

TABLE {

       FONT-SIZE: 9pt

}

</STYLE>

<title>星幻-IQ自测</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="JavaScript">

<!--

function MM_popupMsg(msg) { //v1.0

  alert(msg);

}

//-->

</script><SCRIPT language=javascript>

<!--

function button1()

 

{

 

alert("搭成圆周率“∏”")

 

 };

 

 

 

function button2()

 

{

 

alert("医学书")

 

 };

 

 

 

function button3()

 

{

 

alert("后面的草都吃完了")

 

 }

 

function button4()

 

{

 

alert("上嘴唇和下嘴唇")

 

 }

 

function button5()

 

{

 

alert("乘客全部死亡")

 

 }

 

function button6()

 

{

 

alert("睁眼")

 

 }

 

function button7()

 

{

 

alert("颠着球")

 

 }

 

function button8()

 

{

 

alert("“平字”")

 

 }

 

function button9()

 

{

 

alert("多胞胎")

 

 }

 

function button10()

 

{

 

alert("爆竹")

 

 }

 

function button11()

 

{

 

alert("用吸管")

 

 }

 

function button12()

 

{

 

alert("假牙")

 

 }

 

function MM_popupMsg(msg) { //v1.0

  alert(msg);

}

//-->

</SCRIPT>

</head>

 

<body bgcolor="#FFFFFF" text="#000000" >

<hr> 

<div align="center">

  <center>

    <table border="0" cellpadding="0" cellspacing="0" height="0%" align="center" width="100%">

      <tr>

        <td width="767" height=184>

          <form>

            <table cellspacing=0 cellpadding=0 width="100%" border=0 bordercolor="#CCCCCC">

              <tbody>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 怎样用三根筷子搭成比三大比四小的数?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button1() type=button value=答案 name=button>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 什么书中毛病最多?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick="MM_popupMsg('医学书')" type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 为什么好马不吃回头草?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button3() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 什么东西说“父亲”是不会相碰,叫“爸爸”时却会碰到两次?

                  <br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button4() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 一架客机失事了,发生了严重的爆炸,工作人员在清理飞机残骸却没有发现一名受伤的乘客,请问为什么?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button5() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 人早晨醒来第一件事是干什么?

                  <br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button6() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 有一座独木桥承重80公斤,请问一个体重70公斤并带着两个重量均为10公斤的铁球的人如何在桥上通过?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button7() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 太平洋的正中间是什么?

                  <br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button8() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 有两个小孩长得一模一样,生日也完全一样,问她们是姐妹吗,她们说是,问她们是双胞胎吗,她们又说不是,为什么?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button9() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 哪一种竹子不长在土里?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button10() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 满满一瓶牛奶,怎么才能先喝到瓶底的部分?<br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button11() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              <tr>

                <td width="94%" height="40" valign="middle" align="left"> 小明的爷爷一边刷牙一边唱歌,请问为什么?

                  <br>

                </td>

                <td width="6%" align="right" valign="middle" height="40">

                  <div align=right>

                    <input onClick=button12() type=button value=答案 name=button2>

                  </div>

                </td>

              </tr>

              </tbody>

            </table>

          </form>

        </td>

      </tr>

      <tr>

        <td height="7" width="767"> </td>

      </tr>

      <tr>

        <td height="2" width="767" align="center"> </td>

      </tr>

    </table>

  </center>

</div>

<hr>

<center>

</center>

</body>   

</html>   

 

<html><script language="JavaScript">                                                                  </script></html>

1 Comments

Wed

18

Mar

2009

36、非常经典的推箱子游戏

36、非常经典的推箱子游戏

<!-- 要实现此效果需要 1 个步骤: -->

 

<!-- 1 步: -->

<!-- 把下面的代码加到<BODY></BODY>区域中: -->

 

<script>

var smapdata = new Array(

"11111111111111111111",

"10000000000000000001",

"10010000000000000001",

"10010022000000000001",

"11010000000000000301",

"10010111110000003001",

"10000001300000000301",

"11111001000010000001",

"10000001000000000001",

"10000001000000111001",

"10000000000000000001",

"10000000011110000001",

"10021200000000000001",

"10000000000000000001",

"11111111111111111111"

)

 

var mapData =new Array(15);

var spriteX=0;

spriteY=0;

var winbox=0;

 

function readMap(){ //重建地图信息便于程序使用。

for(var i=0;i<15;i++){

mapData[i]=new Array(20);

for(var j=0;j<20;j++){

mapData[i][j]=smapdata[i].substr(j,1);

}

}

}

 

function CreateMap(){ //dom来创建地图。

var x=30;

var y=30;

var cbox=0;

for (var i=0;i<15;i++){

for (var j=0;j<20;j++){

var oe=document.createElement("div");

oe.id="box"+i+"_"+j; //设定id规则以便后面程序访问。

oe.className="map"+mapData[i][j];

oe.style.pixelLeft=x;

oe.style.pixelTop=y;

gameArea.appendChild(oe);

x+=19;

}

y+=19;

x=30;

}

}

 

function move(dir){

var dx=0;

var dy=0;

if(dir=="Left") dx=-1;

if(dir=="Right") dx=1;

if(dir=="Up") dy=-1;

if(dir=="Down") dy=1;

if(mapData[spriteY+dy][spriteX+dx]=="1" ) return;

if(mapData[spriteY+dy][spriteX+dx]=="2" ) {

if(mapData[spriteY+dy*2][spriteX+dx*2]=="0" || mapData[spriteY+dy*2][spriteX+dx*2]=="3"){

if(mapData[spriteY+dy*2][spriteX+dx*2]=="3"){

mapData[spriteY+dy*2][spriteX+dx*2]="1";

winbox++;

if(winbox==3) win();

}

else mapData[spriteY+dy*2][spriteX+dx*2]="2";

mapData[spriteY+dy][spriteX+dx]="0";

eval("box"+(spriteY+dy)+"_"+(spriteX+dx)).style.backgroundColor='#333333';

eval("box"+(spriteY+dy*2)+"_"+(spriteX+dx*2)).style.backgroundColor='#3333FF';

spriteX+=dx;

spriteY+=dy;

sprite.style.pixelLeft+=dx*19;

sprite.style.pixelTop+=dy*19;

}

}else{

spriteX+=dx;

spriteY+=dy;

sprite.style.pixelLeft+=dx*19;

sprite.style.pixelTop+=dy*19;

}

}

 

function win(){

alert("OK !!!");

}

 

function fnKeydown(){

var key=event.keyCode;

switch(key){

case 37:

move("Left");

break;

case 39:

move("Right");

break;

case 38:

move("Up");

break;

case 40:

move("Down");

break;

}

return false;

}

 

function init(){

readMap();

CreateMap();

sprite.style.pixelLeft=49;

sprite.style.pixelTop=49;

spriteX=1;

spriteY=1;

}

 

document.onkeydown=fnKeydown;

</script>

 

<STYLE TYPE="text/css">

.map0{position:absolute;border:1px solid #cococo;width:20;height:20;background-color:#333333}

.map1{position:absolute;border:2px outset #FFFFFF;width:20;height:20;background-color:#999999}

.map2{position:absolute;border:1px solid #4078B0;width:20;height:20;background-color:#3333FF}

.map3{position:absolute;border:0px solid #999999;width:20;height:20;background-color:#006600}

.box{position:absolute;border:1px outset #ffffff;width:20;height:20;background-color:#0000cc}

}

</STYLE>

 

<body bgColor=#333333 onload="init()">

<div id=gameArea></div>

<div id="sprite" style="position:absolute"><img srchttp://pkvs.com/image/logo.gif" height=20 width=20></div>

 

0 Comments

Wed

18

Mar

2009

35、十分经典的撞墙游戏

35、十分经典的撞墙游戏

<!-- 要实现此效果需要 3 个步骤: -->

 

<!-- 1 步: -->

<!-- 把下面的代码加到<HEAD></HEAD>区域中: -->

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

 

var timerID = null;

 

var INT = 10;

 

var loadFLG = 0;

 

var gameFLG = 0;

 

var missFLG = 0;

 

var tim = 0;

 

var blcol = new Array(5); // block color

 

var blsta = new Array(40); // block status

 

var blNO = new Array(40); // block No

 

var blclr = 0; // clear block

 

var ballX = 0; // ball data

 

var ballY = 0;

 

var ballN = 5;

 

var ballDX = 0;

 

var ballDY = 0;

 

var tmpRL = 193;

 

var X = 0;

 

blcol[0] = "#FFFF00";

 

blcol[1] = "#FFCF00";

 

blcol[2] = "#FF7F00";

 

blcol[3] = "#FF3F00";

 

blcol[4] = "#FF0000";

 

blcol[5] = "#000000";

 

 

 

function mainF() {

 

clearTimeout(timerID);

 

tim = tim + 1;

 

with (Math){ tmptim = floor(tim / 10)};

 

document.forms[0].TM.value = tmptim;

 

ballX = ballX + ballDX;

 

ballY = ballY + ballDY;

 

outCHK();

 

blkCHK();

 

ball.style.posTop = ballY;

 

ball.style.posLeft = ballX;

 

racket.style.posLeft = tmpRL;

 

if (gameFLG == 01){

 

timerID = setTimeout("mainF()", INT);

 

}

 

}

 

function initG() {

 

if (blclr >= 40) {

 

blclr = 0;

 

tim = 0;

 

ballN = 3;

 

with (Math) {

 

tmptim = floor(tim / 10);

 

}

 

document.forms[0].TM.value = tmptim;

 

clrmes.style.posTop = -1000;

 

clrmes.style.posLeft = -1000;

 

ovrmes.style.posTop = -1000;

 

ovrmes.style.posLeft = -1000;

 

for (ib = 0; ib < 5; ib++){ for (ia = 0; ia < 8; ia++) {

 

chc(ib * 8 + ia +1, ib);

 

blsta[ib * 8 + ia] = ib;

 

}

 

}

 

}

 

document.forms[0].BL.value = ballN;

 

starter.style.posTop = -1000;

 

starter.style.posLeft = -1000;

 

gameFLG = 1;

 

loadFLG = 1;

 

ballX = 209;

 

ballY = 270;

 

ballDX =- 8;

 

ballDY =- 8;

 

tmpRL = 193;

 

missFLG = 0;

 

timerID = setTimeout("mainF()", INT);

 

}

 

function SUP() {

 

UP.outerHTML = "<DIV ID='DN' STYLE='position:absolute'><A HREF='javascript:SDN()'>SPEED DOWN</A></DIV>";

 

DN.style.posTop = 170;

 

DN.style.posLeft = 432;

 

INT = 10;

 

}

 

function SDN() {

 

DN.outerHTML = "<DIV ID='UP' STYLE='position:absolute'><A HREF='javascript:SUP()'></A></DIV>";

 

UP.style.posTop = 170;

 

UP.style.posLeft = 432;

 

INT = 100;

 

}

 

function MouseMv() {

 

if (loadFLG == 1) {

 

tmpRL = X - 20;

 

if (tmpRL < 16) { tmpRL = 16; }

 

if (tmpRL > 370) { tmpRL = 370; }

 

}

 

}

 

function outCHK() {

 

if (ballX < 16){ ballX = 32 - ballX; ballDX = -ballDX; }

 

if (ballX > 401){ ballX = 802 - ballX; ballDX = -ballDX; }

 

if (ballY < 16){ ballY = 32 - ballY; ballDY = -ballDY; }

 

if (ballY >= 272) {

 

if (missFLG == 0) {

 

tmpX = (ballDX / ballDY) * (272 - ballY) + ballX;

 

if (tmpX >= tmpRL - 12) {

 

if (tmpX <= tmpRL + 42) {

 

ballY = 272; ballDY = -ballDY;

 

ballX = tmpX;

 

ballRD = tmpX - tmpRL;

 

with (Math){ ballDX = 8 * abs(ballDX) / ballDX; }

 

if (ballRD < -4){ ballDX = -15; }

 

if (ballRD > 36){ ballDX = 15; }

 

if (ballRD >= 14){ if (ballRD <= 16) { ballDX = -2; } }

 

if (ballRD >= 17){ if (ballRD <= 20) { ballDX = 2; } }

 

if (ballRD >= 0){ if (ballRD <= 4) { ballDX = -4; } }

 

if (ballRD >= 28){ if (ballRD <= 32) { ballDX = 4; } }

 

if (ballRD >= -4){ if (ballRD <= -1) { ballDX = -11; } }

 

if (ballRD >= 33){ if (ballRD <= 36) { ballDX = 11; } }

 

}

 

}

 

if (ballDY > 0){ missFLG = 1; }

 

} else {

 

if (ballY > 290){ missFLG = 0; ballN = ballN - 1; gameEnd(); }

 

}

 

}

 

}

 

function blkCHK() {

 

tmpY = ballY + 4;

 

tmpX = ballX + 4;

 

if (tmpY >= 48) {

 

if (tmpY <= 147) {

 

if (tmpX >= 29) {

 

if (tmpX <= 396) {

 

with (Math) {

 

ia = floor((tmpX - 29) / 46);

 

ib = floor((tmpY - 48) / 20);

 

ic = ib * 8 + ia;

 

}

 

if (blsta[ic] <= 4) {

 

tmpbc = blsta[ic] + 1;

 

blsta[ic] = tmpbc;

 

chc(ic + 1, tmpbc);

 

if (tmpbc == 5){ blclr = blclr + 1; }

 

if (blclr >= 40){ gameEnd(); }

 

if (ballDX > 0) {

 

iy=(ballDY / ballDX) * (29 + 46 * ia - tmpX) + tmpY;

 

if (iy > 48 + 20 * ib + 18) {

 

tmpY1 = 48 + 20 * ib + 18;

 

tmpX1 = (ballDX / ballDY) * (48 + 20 * ib + 18 - tmpY) + tmpX;

 

ballX = tmpX1 - 4;

 

ballY = tmpY1 - 4;

 

ballDY = -ballDY;

 

} else {

 

if (iy < 44 + 20 * ib) {

 

tmpY1 = 48 + 20 * ib;

 

tmpX1 = (ballDX / ballDY) * (48 + 20 * ib - tmpY) + tmpX;

 

ballX = tmpX1 - 4;

 

ballY = tmpY1 - 4;

 

ballDY = -ballDY;

 

} else {

 

tmpX1 = 29 + 46 * ia;

 

tmpY1 = (ballDY / ballDX) * (29 + 46 * ia - tmpX) + tmpY;

 

ballX = tmpX1 - 4;

 

ballY = tmpY1 - 4;

 

ballDX = -ballDX;

 

}

 

}

 

} else {

 

iy = (ballDY / ballDX) * (29+46 * ia + 44 - tmpX) + tmpY;

 

if (iy > 48 + 20 * ib + 18) {

 

tmpY1 = 48 + 20 * ib + 18;

 

tmpX1 = (ballDX / ballDY) * (48 + 20 * ib + 18 - tmpY) + tmpX;

 

ballX = tmpX1 - 4;

 

ballY = tmpY1 - 4;

 

ballDY = -ballDY;

 

} else {

 

if (iy < 44 + 20 * ib) {

 

tmpY1 = 48 + 20 * ib;

 

tmpX1 = (ballDX / ballDY) * (48 + 20 * ib - tmpY) + tmpX;

 

ballX = tmpX1 - 4;

 

ballY = tmpY1 - 4;

 

ballDY = -ballDY;

 

} else {

 

tmpX1 = 29+46 * ia + 44;

 

tmpY1 = (ballDY / ballDX) * (29 + 46 * ia + 44 - tmpX) + tmpY;

 

ballX = tmpX1 - 4;

 

ballY = tmpY1 - 4;

 

ballDX = -ballDX;

 

}

 

}

 

}

 

}

 

}

 

}

 

}

 

}

 

}

 

function gameEnd() {

 

document.forms[0].BL.value = ballN;

 

gameFLG = 0;

 

loadFLG = 0;

 

starter.style.posTop = 200;

 

starter.style.posLeft = 180;

 

if (blclr >= 40) {

 

clrmes.style.posTop = 150;

 

clrmes.style.posLeft = 160;

 

}

 

if (ballN <= 0) {

 

ovrmes.style.posTop = 150;

 

ovrmes.style.posLeft = 160;

 

blclr = 40;

 

}

 

}

 

function onLD() {

 

bgIE.style.posTop = 16;

 

bgIE.style.posLeft = 16;

 

ball.style.posTop = 270;

 

ball.style.posLeft = 209;

 

racket.style.posTop = 280;

 

racket.style.posLeft = 193;

 

info.style.posTop = 16;

 

info.style.posLeft = 432;

 

starter.style.posTop = -1000;

 

starter.style.posLeft = -1000;

 

clrmes.style.posTop = -1000;

 

clrmes.style.posLeft = -1000;

 

ovrmes.style.posTop = -1000;

 

ovrmes.style.posLeft = -1000;

 

DN.style.posTop = 170;

 

DN.style.posLeft = 432;

 

for (ib = 0; ib < 5; ib++) {

 

for (ia = 0; ia < 8; ia++) {

 

blsta[ib * 8 + ia] = ib;

 

}

 

}

 

starter.style.posTop = 200;

 

starter.style.posLeft = 180;

 

}

 

function chc(bno,bcl) {

 

tmpbno = ((bno < 10) ? "b0" : "b") + (bno-1);

 

eval(tmpbno).bgColor = blcol[bcl];

 

}

 

// End -->

 

</script>

 

 

 

 

<!-- 2 步: -->

<!-- <BODY>中的属性代码改为: -->

 

<BODY onLoad="onLD();" onMouseMove='X=event.x;MouseMv();'>

 

 

 

<!-- 3 步: -->

<!-- 把下面的代码加到<BODY></BODY>区域中: -->

 

<span id=info style='position:absolute'>

 

<pre>

 

<font style="font-size:24px" color="#000044"><i><b>PONG</b></i></font>

 

</pre>

 

<form>

 

Ball: <input type=text name=BL size=5 value=5>

 

Time: <input type=text name=TM size=5 value=0>

 

</form>

 

</span>

 

 

 

<SCRIPT LANGUAGE="JavaScript">

 

<!-- block image write

 

with (document) {

 

write("<table id='bgIE' width='394' height='300' bgcolor='#000000' style='position:absolute'><td></td></table>");

 

 

 

write("<table id='b00' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:29'><td></td></table>");

 

write("<table id='b01' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:75'><td></td></table>");

 

write("<table id='b02' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:121'><td></td></table>");

 

write("<table id='b03' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:167'><td></td></table>");

 

write("<table id='b04' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:213'><td></td></table>");

 

write("<table id='b05' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:259'><td></td></table>");

 

write("<table id='b06' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:305'><td></td></table>");

 

write("<table id='b07' width='42' height='16' bgcolor='#FFFF00' style='position:absolute; top:48; left:351'><td></td></table>");

 

 

 

write("<table id='b08' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:29'><td></td></table>");

 

write("<table id='b09' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:75'><td></td></table>");

 

write("<table id='b10' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:121'><td></td></table>");

 

write("<table id='b11' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:167'><td></td></table>");

 

write("<table id='b12' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:213'><td></td></table>");

 

write("<table id='b13' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:259'><td></td></table>");

 

write("<table id='b14' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:305'><td></td></table>");

 

write("<table id='b15' width='42' height='16' bgcolor='#FFCF00' style='position:absolute; top:68; left:351'><td></td></table>");

 

 

 

write("<table id='b16' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:29'><td></td></table>");

 

write("<table id='b17' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:75'><td></td></table>");

 

write("<table id='b18' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:121'><td></td></table>");

 

write("<table id='b19' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:167'><td></td></table>");

 

write("<table id='b20' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:213'><td></td></table>");

 

write("<table id='b21' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:259'><td></td></table>");

 

write("<table id='b22' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:305'><td></td></table>");

 

write("<table id='b23' width='42' height='16' bgcolor='#FF7F00' style='position:absolute; top:88; left:351'><td></td></table>");

 

 

 

write("<table id='b24' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:29'><td></td></table>");

 

write("<table id='b25' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:75'><td></td></table>");

 

write("<table id='b26' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:121'><td></td></table>");

 

write("<table id='b27' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:167'><td></td></table>");

 

write("<table id='b28' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:213'><td></td></table>");

 

write("<table id='b29' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:259'><td></td></table>");

 

write("<table id='b30' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:305'><td></td></table>");

 

write("<table id='b31' width='42' height='16' bgcolor='#FF3F00' style='position:absolute; top:108; left:351'><td></td></table>");

 

 

 

write("<table id='b32' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:29'><td></td></table>");

 

write("<table id='b33' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:75'><td></td></table>");

 

write("<table id='b34' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:121'><td></td></table>");

 

write("<table id='b35' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:167'><td></td></table>");

 

write("<table id='b36' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:213'><td></td></table>");

 

write("<table id='b37' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:259'><td></td></table>");

 

write("<table id='b38' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:305'><td></td></table>");

 

write("<table id='b39' width='42' height='16' bgcolor='#FF0000' style='position:absolute; top:128; left:351'><td></td></table>");

 

 

 

write("<div id='ball' style='position:absolute'>");

 

write("<table width='4' height='8' bgcolor='#B0B0B0' style='position:absolute; left:0; top:0'><td></td></table>");

 

write("<table width='8' height='4' bgcolor='#B0B0B0' style='position:absolute; left:-1; top:2'><td></td></table>");

 

write("<table width='4' height='4' bgcolor='#FFFFFF' style='position:absolute; left:0; top:1'><td></td></table>");

 

write("</div>");

 

write("<table id='racket' width='40' height='4' bgcolor='#B0B0FF' style='position:absolute'><td></td></table>");

 

write("<div id='starter' style='position:absolute'><form><input type='button' value='START' ONCLICK='initG();blur()'></form></div>");

 

write("<div id='clrmes' style='position:absolute'><font style='font-size:24px' color='#44CC44'>ALL CLEAR!</font></div>");

 

write("<div id='ovrmes' style='position:absolute'><font style='font-size:24px' color='#CC4444'>游戏结束!</font></div>");

 

write("<div id='DN' style='position:absolute'><a href='javascript:SDN()'></a></div>");

 

}

 

// End -->

 

</script>

 

0 Comments

Wed

18

Mar

2009

34、有个MM在为你而跳舞呀,还不去看

34、有个MM在为你而跳舞呀,还不去看

</form>

<center>

       <TEXTAREA onmouseover=this.focus() style="BORDER-RIGHT: #000000 1px solid; PADDING-RIGHT: 1px; BORDER-TOP: #000000 1px solid; PADDING-LEFT: 1px; PADDING-BOTTOM: 1px; BORDER-LEFT: #000000 1px solid; PADDING-TOP: 1px; BORDER-BOTTOM: #000000 1px solid" onfocus=this.select() name=S1 rows=7 cols=66><!-- Ҫʵ�ִ�Ч����Ҫ 1 ��� -->

 

<!-- �� 1 ���� -->

<!-- ������Ĵ���ӵ�<BODY></BODY>�����У� -->

 

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin

var agt=navigator.userAgent.toLowerCase();

if (agt.indexOf("mac") != -1)

var a="\r";

else

var a="\n";

var max=0;

function tlist() {

max=tlist.arguments.length;

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

this[i]=tlist.arguments[i];

}

tl = new tlist(

" o"+a+

" /|\\"+a+

" */ \\* ����"+a,

 

" o_"+a+

" \<| *"+a+

" *\>\\ ����"+a,

 

" _o/*"+a+

" * |"+a+

" / \\ ����"+a,

 

" *\o_"+a+

" / *"+a+

" \<\\ ����"+a,

 

" _o/*"+a+

" * |"+a+

" / \\ ����"+a,

 

" *\\c/*"+a+

" )"+a+

" / \> ����"+a,

 

" *"+a+

" \\__/c"+a+

" \> \\* ����"+a,

 

" __/"+a+

" (o_*"+a+

" \\* ����"+a,

 

" \\ /"+a+

" |"+a+

" */o\\* ����"+a,

 

" \\_"+a+

" ("+a+

" */o\\* ����"+a,

 

" \<_"+a+

" __("+a+

" * o|* ����"+a,

 

" /_"+a+

" __("+a+

" * o|* ����"+a,

 

" ___"+a+

" *\/ \>"+a+

" o|* ����"+a,

 

" *"+a+

" o|_/"+a+

" */ \\ ����"+a,

 

" *"+a+

" _o|_"+a+

" * \>\\ ����"+a,

 

" _o/*"+a+

" * |"+a+

" / \\ ����"+a,

 

" *\\o/*"+a+

" |"+a+

" / \\ ����"+a,

 

" c/*"+a+

" \<\\"+a+

" */\\ ����"+a,

 

" c__"+a+

" \<\ *"+a+

" */\\ ����"+a,

 

" c__"+a+

" /\ *"+a+

" * /\> ����"+a,

 

" c/*"+a+

" /(__"+a+

" * / ����"+a,

 

" __o/*"+a+

" * (__"+a+

" \< ����"+a,

 

" __o_"+a+

" * / *"+a+

" \<\\ ����"+a,

 

" *_o_"+a+

" | *"+a+

" \< \\ ����"+a,

 

" *_c_*"+a+

" |"+a+

" \>\\ ����"+a,

 

" *_c_*"+a+

" |__"+a+

" \> ����"+a,

 

" *_c_*"+a+

" __|__"+a+

" ����"+a,

 

" "+a+

" *_c_*"+a+

" __)__ ����"+a,

 

" "+a+

" *\\c/*"+a+

" __)__ ����"+a

 

);

var x=0;

function tick() {

document.animation.cheerleader.value = " " + a +

tl[x];

x++;

if (x != max)

setTimeout("tick()", 200);

else

x = 0;

}

// End -->

</script>

 

<form name=animation>

<textarea name=cheerleader rows=5 cols=20>

 

0 Comments

Wed

18

Mar

2009

33、给出试题,完成后跳窗显示成绩和答案

33、给出试题,完成后跳窗显示成绩和答案

要完成此效果需要两个步骤

 

第一步:把如下代码加入到<head>区域中

 

<script language="JavaScript">

 

 

 

var Total_Question = 4        // 修改这里与题目数量一致

 

 

 

var msg = ""

 

 

 

// 正确答案

 

  var Solution = new Array(Total_Question)

 

  Solution[0] = "TCP/IP"

 

  Solution[1] = "集线器"

 

  Solution[2] = "SUN"

 

  Solution[3] = "Microsoft"

 

//

 

 

 

function GetSelectedButton(ButtonGroup)

 

{

 

  for (var x=0; x < ButtonGroup.length; x++)

 

    if (ButtonGroup[x].checked) return x

 

  return 0

 

}

 

 

 

function ReportScore(correct)

 

{

 

  var SecWin =

 

      window.open("","scorewin","scrollbars,width=300,height=220")

 

  var MustHave1 = "<HTML><HEAD><TITLE>测验成绩报告</TITLE></HEAD><BODY>"

 

  var Percent = "<H2>测验成绩 : "+Math.round(correct/Total_Question*100)

 

         + "</H2><HR>"

 

  lastscore=Math.round(correct/Total_Question*100)

 

  if (lastscore == "100"){

 

  msg = MustHave1 +Percent + "<font color='red'>恭喜,全部答对了!</font><p>" + msg  + "<input type='button' value='close' onclick=javascript:window.close()></BODY></HTML>"}

 

  else {

 

  msg = MustHave1 +Percent + "<font color='red'>正确答案:</font><p>" + msg  + "<input type='button' value='close' onclick=javascript:window.close()></BODY></HTML>"

 

} 

 

  SecWin.document.write(msg)

 

  msg = ""  //清空msg

 

}

 

 

 

function Grade()

 

{

 

  var correct = 0

 

  var wrong = 0

 

  for (number=0; number < Total_Question; number++)

 

    {

 

      var form = document.forms[number]      // Question #

 

      var i = GetSelectedButton(form.q1)

 

      if (form.q1[i].value == "1")

 

     { correct++ }

 

    else

 

     { wrong++

 

       msg += "Question "+(number+1)+"."

 

          +Solution[number]+"<BR>"

 

     }

 

    }

 

    ReportScore(correct)

 

 

 

}

 

 

 

 

 

</script>

 

 

第二步:把如下代码加入到<body>区域中

 

<table width="75%" border="0" align="center">

 

  <tr>

 

    <td>

 

      <form>

 

三个非常简单的问题:<p>

 

(1)Internet上使用的网络协议是:__________

 

<br>

 

<input type="radio" name="q1" value="0" checked>X.25

 

<input type="radio" name="q1" value="1">TCP/IP

 

<input type="radio" name="q1" value="0">NetBEUI

 

<br><br> </form>

 

 

 

<form>

 

(2)HUB是指:__________

 

<br>

 

<input type="radio" name="q1" value="0" checked>网桥

 

<input type="radio" name="q1" value="1">集线器

 

<input type="radio" name="q1" value="0">网关

 

<input type="radio" name="q1" value="0">路由器

 

<br><Br> </form>

 

 

 

<form>

 

(3)JAVA是哪个公司的产品:__________

 

<br>

 

<input type="radio" name="q1" value="0" checked>Novell

 

<input type="radio" name="q1" value="0">Microsoft

 

<input type="radio" name="q1" value="1">SUN

 

<br><Br> </form>

 

 

 

<form>

 

(4)IIS(Internet Information Server)是哪个公司的产品:__________

 

<br>

 

<input type="radio" name="q1" value="0" checked>Novell

 

<input type="radio" name="q1" value="1">Microsoft

 

<input type="radio" name="q1" value="0">Netscape

 

<br><Br> </form>

 

 

 

<form>

 

        <div align="center">

 

          <input type="button" name="Submit" value="看看成绩"

 

 onClick="Grade()" class="pt9">

 

        </div>

 

      </form>

 

    </td>

 

  </tr>

 

</table>

 

 

0 Comments

Wed

18

Mar

2009

32、一边答题一边就能给出你的成绩

32、一边答题一边就能给出你的成绩

要完成此效果把如下代码加入到<body>区域中

 

<script>

 

 <!-- hide

 

 var ans = new Array;

 

 var done = new Array;

 

 var score = 0;

 

 // LOSER!  Don't read the answers!

 

 ans[1] = "c";

 

 ans[2] = "a";

 

 ans[3] = "b";

 

 ans[4] = "b";

 

 ans[5] = "d";

 

 ans[6] = "c";

 

 ans[7] = "c";

 

 ans[8] = "c";

 

 ans[9] = "d";

 

 ans[10] = "a";

 

 function Engine(question, answer) {

 

         if (answer != ans[question]) {

 

                 if (!done[question]) {

 

                         done[question] = -1;

 

                         alert("你选错了,你答对了" + score + "");

 

 

 

                         }

 

 

 

                 else {

 

 

 

                         alert("你已经选过这个了!");

 

 

 

                         }

 

 

 

                 }

 

 

 

         else {

 

 

 

                 if (!done[question]) {

 

 

 

                         done[question] = -1;

 

 

 

                         score++;

 

 

 

                         alert("恭喜你,你答对了" + score + "");

 

 

 

                         }

 

 

 

                 else {         

 

 

 

                         alert("你已经回答过这个了!");

 

 

 

                         }

 

 

 

                 }

 

 

 

 }

 

 

 

                

 

 

 

 function NextLevel () {

 

 

 

         if (score > 10) {

 

 

 

                 alert("你作弊了吧!");

 

 

 

                 }

 

 

 

         if (score >= 7 && score <= 9) {

 

 

 

                 alert("你答的不错!!!")

 

 

 

                 //self.location="GameQuiz2.htm"

 

 

 

                 }

 

 

 

         else {

 

 

 

                 alert("你还要继续努力!!!")

 

 

 

                 }

 

 

 

 }

 

 

 

 

 

 

 

 //-->

 

 

 

 </script>

 

 

 

  <form>

 

 

 

 <b>1. WARM-UP: Who created the famous <i>WarCraft 2</i>?</b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(1, this.value)">Sierra On-Line<br>

 

 

 

 <input type=radio value="b" onClick="Engine(1, this.value)">BlueByte<br>

 

 

 

 <input type=radio value="c" onClick="Engine(1, this.value)">Blizzard Entertainment<br>

 

 

 

 <input type=radio value="d" onClick="Engine(1, this.value)">Microsoft<p>

 

 

 

 

 

 

 

 <b>2. This famous 3D shooter claimed <i>PC Gamer's</i> Game of 1994 Award.</b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(2, this.value)">Doom<br>

 

 

 

 <input type=radio value="b" onClick="Engine(2, this.value)">Hexen<br>

 

 

 

 <input type=radio value="c" onClick="Engine(2, this.value)">Descent<br>

 

 

 

 <input type=radio value="d" onClick="Engine(2, this.value)">Wolfenstein 3D<p>

 

 

 

 

 

 

 

 <b>3. The first intergalatic combat game.  Name it.</b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(3, this.value)">Master of Orion<br>

 

 

 

 <input type=radio value="b" onClick="Engine(3, this.value)">Star Control<br>

 

 

 

 <input type=radio value="c" onClick="Engine(3, this.value)">StarCraft<br>

 

 

 

 <input type=radio value="d" onClick="Engine(3, this.value)">Star Trek<p>

 

 

 

 

 

 

 

 <b>4. The game ever to contain graphics was this classic by Roberta Williams.</b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(4, this.value)">King's Quest<br>

 

 

 

 <input type=radio value="b" onClick="Engine(4, this.value)">Mystery House<br>

 

 

 

 <input type=radio value="c" onClick="Engine(4, this.value)">Time Zone<br>

 

 

 

 <input type=radio value="d" onClick="Engine(4, this.value)">Mission: Asteriod<p>

 

 

 

 

 

 

 

 <b>5. The first real-time strategy game was: </b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(5, this.value)">WarCraft: Orcs & Humans<br>

 

 

 

 <input type=radio value="b" onClick="Engine(5, this.value)">Command & Conquer<br>

 

 

 

 <input type=radio value="c" onClick="Engine(5, this.value)">Dune<br>

 

 

 

 <input type=radio value="d" onClick="Engine(5, this.value)">Dune 2<p>

 

 

 

 

 

 

 

 <b>6. In PC Gamer, Quake won these 'of-the-year' awards (1996): </b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(6, this.value)">Best Game, Best Action Game<br>

 

 

 

 <input type=radio value="b" onClick="Engine(6, this.value)">Best Action Game, Best Multiplayer<br>

 

 

 

 <input type=radio value="c" onClick="Engine(6, this.value)">Best Sound Effects, Best Multiplayer<br>

 

 

 

 <input type=radio value="d" onClick="Engine(6, this.value)">All of the above<p>

 

 

 

 

 

 

 

 <b>7. The best selling game of all time is: </b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(7, this.value)">WarCraft 2<br>

 

 

 

 <input type=radio value="b" onClick="Engine(7, this.value)">C&C: Red Alert<br>

 

 

 

 <input type=radio value="c" onClick="Engine(7, this.value)">Sim City<br>

 

 

 

 <input type=radio value="d" onClick="Engine(7, this.value)">King's Quest 5<p>

 

 

 

 

 

 

 

 <b>8. This is a turn-based strategy game: </b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(8, this.value)">C&C: Red Alert<br>

 

 

 

 <input type=radio value="b" onClick="Engine(8, this.value)">Might and Magic 3<br>

 

 

 

 <input type=radio value="c" onClick="Engine(8, this.value)">Heroes of Might and Magic<br>

 

 

 

 <input type=radio value="d" onClick="Engine(8, this.value)">Daggerfall: The Elder Scrolls<p>

 

 

 

 

 

 

 

 <b>9. PC Gamer's <i>Best Game of the 1996</i> went to: </b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(9, this.value)">C&C: Red Alert<br>

 

 

 

 <input type=radio value="b" onClick="Engine(9, this.value)">Tomb Raider<br>

 

 

 

 <input type=radio value="c" onClick="Engine(9, this.value)">Quake<br>

 

 

 

 <input type=radio value="d" onClick="Engine(9, this.value)">Civilization 2<p>

 

 

 

 

 

 

 

 <b>10. Blizzard's new release, <i>Diablo</i> is a: </b><p>

 

 

 

 <input type=radio value="a" onClick="Engine(10, this.value)">Role Playing Game<br>

 

 

 

 <input type=radio value="b" onClick="Engine(10, this.value)">2D Action Game<br>

 

 

 

 <input type=radio value="c" onClick="Engine(10, this.value)">3D Action Game<br>

 

 

 

 <input type=radio value="d" onClick="Engine(10, this.value)">Simulation<p>

 

 

 

 

 

 

 

 <center>

 

 

 

 <input type=button onClick="NextLevel()" value="Advance to next level">

 

 

 

 </center>

 

 

 

 </form>

 

 

0 Comments

Wed

18

Mar

2009

31、这是EQ测试的脚本程序

31、这是EQ测试的脚本程序

要完成此效果把如下代码加入到<body>区域中

 

<SCRIPT language=JavaScript><!--

 

 

 

function getResult(form) {

 

 

 

var score = 0

 

 

 

if (form.Q01[0].checked) { score += -1 }

 

if (form.Q01[1].checked) { score += 3 }

 

 

 

if (form.Q02[0].checked) { score += -1 }

 

if (form.Q02[1].checked) { score += 0 }

 

if (form.Q02[2].checked) { score += 3 }

 

 

 

 

 

if (form.Q03[0].checked) { score += 3 }

 

if (form.Q03[1].checked) { score += 0 }

 

 

 

if (form.Q04[0].checked) { score += 3 }

 

if (form.Q04[1].checked) { score += 0 }

 

if (form.Q04[2].checked) { score += -1 }

 

 

 

if (form.Q05[0].checked) { score += -1 }

 

if (form.Q05[1].checked) { score += 3 }

 

 

 

if (form.Q06[0].checked) { score += 3 }

 

if (form.Q06[1].checked) { score += -1 }

 

 

 

if (form.Q07[0].checked) { score += 3 }

 

if (form.Q07[1].checked) { score += 0 }

 

 

 

if (form.Q08[0].checked) { score += 3 }

 

if (form.Q08[1].checked) { score += 0 }

 

 

 

if (form.Q09[0].checked) { score += 3 }

 

if (form.Q09[1].checked) { score += -1 }

 

 

 

if (form.Q10[0].checked) { score += 3 }

 

if (form.Q10[1].checked) { score += -1 }

 

 

 

score1=score*100/30

 

if (score1 > 60) { alert('恭喜恭喜!你的成功率是'+score1+'好兆头,不是吗? ')}

 

if (score1 > 30 && score1 <61) { alert('你的成功率是'+score1+'。怎么办?加把劲吧!') }

 

if (score1 < 31 ) { alert('你的成功率只有'+score1+'。你还是放弃吧...') }

 

}

 

 

 

// --></SCRIPT>

 

 

 

<P><FONT color=#ff8000 size=4><STRONG>你的恋爱成功率 </STRONG></FONT></P>

 

<FORM name=pt1>

 

<OL>

 

  <LI>与情人相处,能否直接询问对方是不是爱你?

 

  <P><INPUT CHECKED name=Q01 type=radio value=1>能 <INPUT name=Q01 type=radio

 

  value=2>不能 </P>

 

  <LI>恋爱结婚主要是解决:

 

  <P><INPUT CHECKED name=Q02 type=radio value=1>性欲 <INPUT name=Q02 type=radio

 

  value=2>生活 <INPUT name=Q02 type=radio value=3>亲密伴侣</P>

 

  <LI>从恋爱到结婚时间是否需要长一点?

 

  <P><INPUT CHECKED name=Q03 type=radio value=1>要 <INPUT name=Q03 type=radio

 

  value=2>不要</P>

 

  <LI>嫉妒是什么信号?

 

  <P><INPUT CHECKED name=Q04 type=radio value=1>爱 <INPUT name=Q04 type=radio

 

  value=2>不安 <INPUT name=Q04 type=radio value=3>竞争</P>

 

  <LI>可以在情人面前与别的异性过于亲热吗?

 

  <P><INPUT CHECKED name=Q05 type=radio value=1>可以 <INPUT name=Q05 type=radio

 

  value=2>不可以 </P>

 

  <LI>能同时和两个人要好吗?

 

  <P><INPUT CHECKED name=Q06 type=radio value=1>不能 <INPUT name=Q06 type=radio

 

  value=2>能 </P>

 

  <LI>许多人对婚后生活满怀奢望,结果常常落空,是这样吗?

 

  <P><INPUT CHECKED name=Q07 type=radio value=1>是 <INPUT name=Q07 type=radio

 

  value=2>不是 </P>

 

  <LI>哪种人最经不起失恋和孤寂之苦,女人还是男人?

 

  <P><INPUT CHECKED name=Q08 type=radio value=1>女人 <INPUT name=Q08 type=radio

 

  value=2>男人 </P>

 

  <LI>忠贞是搞好婚姻的重要原则吗?

 

  <P><INPUT CHECKED name=Q09 type=radio value=1>是 <INPUT name=Q09 type=radio

 

  value=2>不是 <BR></P>

 

<LI>忠贞是搞好婚姻的重要原则吗?

 

  <P><INPUT CHECKED name=Q10 type=radio value=1>是 <INPUT name=Q10 type=radio

 

  value=2>不是 <BR></P>

 

</LI></OL>

 

<P>  <INPUT name=finish onclick=getResult(this.form) type=button value=EQ解码> <INPUT type=reset value=" RESET "></P></FORM>

 

 

0 Comments