?? 02c.htm
字號:
<html>
<head>
<title>圍格子</title>
<meta http-equiv="目錄類型" content="文本/html; 字符集=gb2312">
<style type="text/css">
<!--
a{font-style:normal;text-decoration:none;color:white}
a:hover {BACKGROUND:red;font-style:normal;text-decoration:none;color:yellow}
a:active {font-style:normal;text-decoration:none;color:yellow;}
.white { color: #FFFFFF}
table { font-size: 9pt}
-->
</style>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#009900" topmargin="0" leftmargin="0">
<form name="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#009900">
<td colspan="3" height="18"> </td>
</tr>
<tr>
<td bgcolor="#009900" width="18"></td>
<td align="center" bgcolor="#FFFFFF" valign="top"> <br>
<table width="56%" border="0" cellspacing="0" cellpadding="0" height="355">
<tr>
<td rowspan="2" width="16" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="white" style="FONT-SIZE: 11pt;">
<tr bgcolor="#336699" bordercolor="#336699">
<td style="BORDER-RIGHT: double; BORDER-TOP: double; BORDER-LEFT: double; BORDER-BOTTOM: double;" height="70"><strong><a href="02.htm">演<br>
<br>
示</a></strong></td>
</tr>
<tr bordercolor="#009900" bgcolor="#009900">
<td style="BORDER-RIGHT: double; BORDER-TOP: double; BORDER-LEFT: double; BORDER-BOTTOM: double" height="70"><strong><a href="02c.htm">源<br>
代<br>
碼</a></strong></td>
</tr>
</table>
</td>
<td rowspan="2" width="8" bgcolor="#009900"> </td>
<td align="center" style="BORDER-RIGHT: double; BORDER-TOP: double; FONT-SIZE: 12pt; BORDER-LEFT: double; BORDER-BOTTOM: double" bordercolor="#009900" valign="top">
<b> </b><br>
<b>圍格子</b>
<hr width="92%" size="1" align="center">
<table cellspacing="0" cellpadding="0" width="81%">
<tr>
<td colspan="2" height="25">注釋:放在<head>與</head>之間</td>
</tr>
<tr>
<td colspan="2">
<p>
<textarea name="head" onFocus="this.select()" onMouseOver="this.focus()" cols="50" style="BACKGROUND-COLOR: #009900;" wrap="VIRTUAL" class="pt9" rows="7"><script>
function ShowMenu(bMenu) {
document.all.idFinder.style.display = (bMenu) ? "none" : "block"
document.all.idMenu.style.display = (bMenu) ? "block" : "none"
idML.className = (bMenu) ? "cOn" : "cOff"
idRL.className = (bMenu) ? "cOff" : "cOn"
return false
}
</script>
<script>
<!--
function addList(url,desc) {
if ((navigator.appName=="Netscape") || (parseInt(navigator.appVersion)>=4)) {
var w=window.open("","_IDHTML_LIST_","top=0,left=0,width=475,height=150,history=no,menubar=no,status=no,resizable=no")
var d=w.document
if (!w._init) {
d.open()
d.write("<TITLE>Loading...</TITLE><EM>Loading...</EM>")
d.close()
d.location.replace("/assist/listing.asp?url="+escape(url)+"&desc="+escape(desc))
w.opener=self
window.status="Personal Assistant (Adding): " + desc
} else {
window.status=w.addOption(url,desc)
w.focus()
}
}
else
alert("Your browser does not support the personal assistant.")
return false
}
// -->
</script>
<style>
<!--
A.cOn {text-decoration:none;font-weight:bolder}
#article {font: 12pt Verdana, geneva, arial, sans-serif; background: white; color: black; padding: 10pt 15pt 0 5pt}
#article P.start {text-indent: 0pt}
#article P {margin-top:0pt;font-size:10pt;text-indent:12pt}
#article #author {margin-bottom:5pt;text-indent:0pt;font-style: italic}
#pageList P {padding-top:10pt}
#article H3 {font-weight:bold}
#article DL, UL, OL {font-size: 10pt}
-->
</style>
<style>
#board {font-family: arial}
.dot {position: absolute; width: 5px; height: 5px; font-size: 0pt; background: black}
#line {position: absolute; font-size: 0pt; height: 5px}
.p1 {position: absolute; font-size: 0pt;background: navy}
.p2 {position: absolute; font-size: 0pt; background: red}
.p1B {position: absolute; font-size: 8pt; color: navy;text-align: center; font-weight: bold}
.p2B {position: absolute; font-size: 8pt; color: red; text-align: center; font-weight: bold}
</style></textarea>
</td>
</tr>
<tr>
<td height="25" colspan="2">注釋:放在<body>與</body>之間</td>
</tr>
<tr>
<td colspan="2">
<textarea name="Code" onFocus="this.select()" onMouseOver="this.focus()" cols="50" wrap="VIRTUAL" style="BACKGROUND-COLOR: #009900;" class="pt9" rows="7"><table width="90%" border="1">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="44%" height="11" align="center"><font color="#FF0000"><b>紅方得分:</b></font></td>
<td id="red" height="11" width="6%">0</td>
<td width="44%" height="11" align="center"><font color="#0000CC"><b><font color="#003399">藍方得分:</font></b></font></td>
<td id="navy" height="11" width="6%">0</td>
</tr>
</table>
</td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35%" align="right">游戲大小:</td>
<td width="15%">
<input type="Text" value="5" id="setSize" size="2" name="Text2">
</td>
<td align="center" width="50%">
<input type="button" onClick="createGame()"
value="重新開始" name="button2">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td height="30">
<p class="start" id="message">藍方先走!!!</p>
</td>
</tr>
<tr align="center">
<td>
<script>
/* DHTML Dots is copyright 1998 insideDHTML.com, LLC. All rights reserved.
DHTML Dots cannot be reproduced in any manner without prior consent from insideDHTML.com */
var scale= 25
var size = 5
var totalSize = ((size+1)*scale) + 6
var cache = new Object()
var move=0,point=0
var player = true
function initCache() {
cache.x = 0
cache.y = 0
cache.red = 0
cache.navy = 0
move=0,point=0
}
function updateScore() {
document.all.red.innerText = cache.red
document.all.navy.innerText = cache.navy
if ((cache.red+cache.navy)==((size-1)*(size-1))) {
board.onclick = null
document.all.message.innerText = "游戲結束!"
}
}
function fillPos(x,y) {
document.all.board.insertAdjacentHTML("beforeEnd","<DIV class=" + (player ? "p1B" : "p2B") + " ID=\"point"+point+"\">" + (player ? "N" : "R") + "</DIV>")
var el = document.all["point"+point].style
el.pixelTop = (y*scale)+5
el.pixelLeft = (x*scale)+5
el.pixelWidth = scale - 5
el.pixelHeight = scale - 5
}
function checkBoard(x,y,dir, player) {
var piece=0
if ("vertical"==dir) {
if ((x==size) || (x>1)) {
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -