资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
js 钻石棋网页游戏代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>钻石棋游戏</title> <style> body{text-align:center; font-size:12px;} td{font-size:12px;text-align:center} table .qz{ border:1px solid #ccc; padding:0px; margin:0px;} .ayc{ background:#fff; background-image:none} table td{width:60px; height:60px;} table td input,.axs{ height:60px; width:60px; border:0px; background:url(/upload/2010-3/20100303233932866.gif) no-repeat center center; color:#ccc; font-size:12px} #zhuangtai{ font-size:16px;} .axz{height:60px; width:60px; border:0px; background:url(/upload/2010-3/20100303233933912.gif) no-repeat center center; } .zhuangt{ height:30px; line-height:30px; font-size:12px;} .zhuangt span{ color:red; font-weight:bold;} </style> </head> <body> <h1 style="text-align:center;">独立钻石棋</h1> <p> <div class="zhuangt"> 剩余<span id='zhuangtai'>32</span> 个棋子、共走<span id='bushu'>0</span>步 </div> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%20%0D%0Avar%20x%2Cy%2Cx1%2Cy1%2Ca1%2Ca2%2Can%3D0%2Cqzs%3D0%2Cstr%3D%22%22%2Cbs%3D0%3B%20%0D%0Avar%20xy%20%3Dnew%20Array()%20%3B%20%0D%0Axy%5B0%5D%3Dnew%20Array()%3B%20%0D%0Axy%5B1%5D%3Dnew%20Array()%3B%20%0D%0Axy%5B2%5D%3Dnew%20Array()%3B%20%0D%0Axy%5B3%5D%3Dnew%20Array()%3B%20%0D%0Axy%5B4%5D%3Dnew%20Array()%3B%20%0D%0Axy%5B5%5D%3Dnew%20Array()%3B%20%0D%0Axy%5B6%5D%3Dnew%20Array()%3B%20%0D%0Afunction%20xz(x%2Cy)%20%0D%0A%7B%20%0D%0Avar%20a1%3Ddocument.getElementById(%22n%22%2Bx%2By)%3B%20%0D%0A%2F%2Falert(x%2B%22-%22%2By%2B%22-%22%2Bx1%2B%22-%22%2By1%2B%22-%22%2Bxy%5Bx%2Cy%5D)%3B%20%0D%0Aif(an%3D%3D0%20%26%26%20xy%5Bx%5D%5By%5D%3D%3D1)%7B%20%0D%0Aa1.className%3D%22axz%22%3B%20%0D%0Aa2%3Da1%3B%20%0D%0Aan%3D1%3B%20%0D%0Ax1%3Dx%3B%20%0D%0Ay1%3Dy%3B%20%0D%0A%7D%20%0D%0Aelse%20if(an%3D%3D1)%20%0D%0A%7B%20%0D%0Aif(ks2(x%2Cy%2Cx1%2Cy1)%3D%3D1)%7B%20%0D%0Axy%5Bx1%5D%5By1%5D%3D0%3B%20%0D%0Aa1.className%3D%22axs%22%3B%20%0D%0Axy%5Bx%5D%5By%5D%3D1%3B%20%0D%0Aa2.className%3D%22ayc%22%3B%20%0D%0Aqzs%3Dqzs-1%3B%20%0D%0Abs%3Dbs%2B1%3B%20%0D%0Adocument.getElementById(%22zhuangtai%22).innerHTML%3Dqzs%3B%20%0D%0Adocument.getElementById(%22bushu%22).innerHTML%3Dbs%3B%20%0D%0A%7Delse%20%0D%0A%7B%20%0D%0Aa2.className%3D%22axs%22%3B%20%0D%0A%7D%20%0D%0Aan%3D0%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%2F%2F%E6%A3%80%E6%B5%8B%E6%A3%8B%E5%AD%90%20%0D%0Afunction%20ks(x%2Cy)%20%0D%0A%7B%20%0D%0Aif(x%3C%3D1%20%26%26%20y%3C%3D1%20%7C%7C%20x%3C%3D1%20%26%26%20y%3E%3D5%20%7C%7C%20x%3E%3D5%20%26%26%20y%3C%3D1%20%7C%7C%20x%3E%3D5%20%26%26%20y%3E%3D5%20%7C%7C%20x%3D%3D3%20%26%26%20y%3D%3D3)%7B%20%0D%0Axs%3D0%3B%20%0D%0A%7D%20%0D%0Aelse%20%0D%0A%7B%20%0D%0Axs%3D1%3B%20%0D%0A%7D%20%0D%0Areturn%20xs%3B%20%0D%0A%7D%20%0D%0Afunction%20ks2(x%2Cy%2Cx1%2Cy1)%20%0D%0A%7B%20%0D%0Axs%3D0%3B%20%0D%0Aif(x%3D%3Dx1%20%26%26%20(y-2%3D%3Dy1%20%7C%7C%20y%2B2%3D%3Dy1)%20%26%26%20xy%5Bx%5D%5By%5D%3D%3D0)%20%0D%0A%7B%20%0D%0Aif(y-2%3D%3Dy1%20%26%26%20xy%5Bx%5D%5By-1%5D%3D%3D1)%7B%20%0D%0Axs%3D1%3B%20%0D%0Ayincang(x%2Cy-1)%3B%20%0D%0A%7Delse%20if(y%2B2%3D%3Dy1%20%26%26%20xy%5Bx%5D%5By%2B1%5D%3D%3D1)%7B%20%0D%0Axs%3D1%3B%20%0D%0Ayincang(x%2Cy%2B1)%3B%20%0D%0A%7D%20%0D%0A%7Delse%20if(y%3D%3Dy1%20%26%26%20(x-2%3D%3Dx1%20%7C%7C%20x%2B2%3D%3Dx1)%20%26%26%20xy%5Bx%5D%5By%5D%3D%3D0)%20%0D%0A%7B%20%0D%0Aif(x-2%3D%3Dx1%20%26%26%20xy%5Bx-1%5D%5By%5D%3D%3D1)%7B%20%0D%0Axs%3D1%3B%20%0D%0Ayincang(x-1%2Cy)%3B%20%0D%0A%7Delse%20if(x%2B2%3D%3Dx1%20%26%26%20xy%5Bx%2B1%5D%5By%5D%3D%3D1)%7B%20%0D%0Axs%3D1%3B%20%0D%0Ayincang(x%2B1%2Cy)%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0Areturn%20xs%3B%20%0D%0A%7D%20%0D%0Afunction%20yincang(x%2Cy)%20%0D%0A%7B%20%0D%0Axy%5Bx%5D%5By%5D%3D0%3B%20%0D%0Adocument.getElementById(%22n%22%2Bx%2By).className%3D%22ayc%22%3B%20%0D%0A%7D%20%0D%0Afunction%20zb(x%2Cy)%20%0D%0A%7B%20%0D%0Afor%20(x%3D0%3Bx%3C%3D6%3Bx%2B%2B)%20%0D%0A%7B%20%0D%0Afor%20(y%3D0%3By%3C%3D6%3By%2B%2B)%20%0D%0A%7B%20%0D%0Aif(ks(x%2Cy)%3D%3D1)%20%0D%0A%7B%20%0D%0Adocument.getElementById(%22n%22%2Bx%2By).className%3D%22ayc%22%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%7D%20%0D%0Adocument.getElementById(%22n25%22).className%3D%22axs%22%3B%20%0D%0A%7D%20%0D%0Adocument.write(%22%3Ctable%3E%22)%3B%20%0D%0Afor%20(x%3D0%3Bx%3C%3D6%3Bx%2B%2B)%20%0D%0A%7B%20%0D%0Adocument.write(%22%3Ctr%3E%22)%3B%20%0D%0Afor%20(y%3D0%3By%3C%3D6%3By%2B%2B)%20%0D%0A%7B%20%0D%0Aif(ks(x%2Cy)%3D%3D1%20%7C%7C%20(x%3D%3D3%20%26%26%20y%3D%3D3))%7B%20%0D%0Axy%5Bx%5D%5By%5D%3D1%3B%20%0D%0A%2F%2Fstr%3Dstr%2B%22%2C%22%2Bx%2B%22%2C%22%2By%2B%22-%22%2Bxy%5Bx%5D%5By%5D%2B%22%3Cbr%3E%22%3B%20%0D%0A%2F%2Falert(x%2B%22-%22%2By%2B%22-%22%2Bx1%2B%22-%22%2By1%2B%22%2Bxy%5Bx%5D%5By%5D%2B%22)%3B%20%0D%0Adocument.write(%22%3Ctd%20class%3D'qz'%3E%3Cinput%20id%3D'n%22%2Bx%2By%2B%22'%20type%3D'button'%20value%3D''%20onclick%3D'xz(%22%2Bx%2B%22%2C%22%2By%2B%22)'%2F%3E%3C%2Ftd%3E%22)%3B%20%0D%0A%7D%20%0D%0Aelse%7B%20%0D%0Adocument.write(%22%3Ctd%3E%3C%2Ftd%3E%22)%3B%20%0D%0A%7D%20%0D%0A%7D%20%0D%0Adocument.write(%22%3C%2Ftr%3E%22)%3B%20%0D%0A%7D%20%0D%0Adocument.write(%22%3C%2Ftable%3E%22)%3B%20%0D%0Adocument.getElementById(%22n33%22).className%3D%22ayc%22%3B%20%0D%0Aqzs%3D32%3B%20%0D%0Axy%5B3%5D%5B3%5D%3D0%3B%20%0D%0A%2F%2Fdocument.write(str)%3B%20%0D%0A%3C%2Fscript%3E"> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程