?? 用asp網上“五子棋"大.htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0052)http://www.meetchinese.com/earticles/show.cgi?id=903 -->
<HTML><HEAD><TITLE>用ASP實現網上“五子棋”大賽 - 讀者網摘</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>TD {
FONT-SIZE: 14px
}
LI {
FONT-SIZE: 14px
}
SELECT {
FONT-SIZE: 14px
}
INPUT {
FONT-SIZE: 14px
}
.f7 {
FONT-SIZE: 7px
}
.f24 {
FONT-SIZE: 24px
}
.f14 {
FONT-SIZE: 14px
}
.l17 {
LINE-HEIGHT: 170%
}
A:link {
COLOR: #0000ff
}
A:visited {
COLOR: #800080
}
A:active {
COLOR: #ff0000
}
A:hover {
COLOR: #ff0000
}
A.a01:link {
COLOR: #07015b; TEXT-DECORATION: none
}
A.a01:visited {
COLOR: #07015b; TEXT-DECORATION: none
}
A.a01:active {
COLOR: #ff0000; TEXT-DECORATION: none
}
A.a01:hover {
COLOR: #ff0000; TEXT-DECORATION: none
}
A.a02:link {
COLOR: #0000ff; TEXT-DECORATION: none
}
A.a02:visited {
COLOR: #0000ff; TEXT-DECORATION: none
}
A.a02:active {
COLOR: #ff0000; TEXT-DECORATION: none
}
A.a02:hover {
COLOR: #ff0000; TEXT-DECORATION: none
}
A.sp1:link {
COLOR: #0000ff; TEXT-DECORATION: none
}
A.sp1:visited {
COLOR: #0000ff; TEXT-DECORATION: none
}
A.sp1:active {
COLOR: #ff0000; TEXT-DECORATION: none
}
A.sp1:hover {
COLOR: #ff0000; TEXT-DECORATION: none
}
.bsgb {
COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none
}
A.bsgb:link {
COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none
}
A.bsgb:visited {
COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none
}
A.bsgb:active {
COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none
}
A.bsgb:hover {
COLOR: #ffffff; FONT-SIZE: 12px; TEXT-DECORATION: none
}
.x14 {
FONT-SIZE: 14px; LINE-HEIGHT: 130%
}
.title12 {
FONT-SIZE: 12px
}
.title14 {
FONT-SIZE: 14px; LINE-HEIGHT: 130%
}
P {
FONT-SIZE: 14px; LINE-HEIGHT: 170%
}
</STYLE>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=5 topMargin=5 marginheight="5" marginwidth="5">
<SCRIPT language=javascript>function sendmail(id){window.open("http://www.meetchinese.com/earticles/mail.cgi?id="+id,"","height=240,width=470,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no");}function review(id){window.open("http://www.meetchinese.com/earticles/review.cgi?action=show&id="+id,"","height=500,width=550,resizable=no,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}function checksearch(){ if (document.search.key.value=="") { alert("請輸入想查詢的內容!"); document.search.key.focus(); return false; } return true;}</SCRIPT>
<DIV align=center>
<TABLE border=0 cellSpacing=0 width=750>
<TBODY>
<TR>
<TD width="100%">您的位置: <A
href="http://www.meetchinese.com/">MeetChinese.com</A> > <A
href="http://www.meetchinese.com/earticles/main.cgi">讀者網摘</A> > <A
href="http://www.meetchinese.com/earticles/list.cgi?class=9">ASP</A> >
<A
href="http://www.meetchinese.com/earticles/list.cgi?class=9&type=102">ASP程序制作</A>
> 正文 -- <A
href="javascript:window.external.AddFavorite('http://www.meetchinese.com/earticles/show.cgi?id=903', '用ASP實現網上“五子棋”大賽')"
target=_self>收藏本文</A>
<HR noShade SIZE=1>
</TD></TR></TBODY></TABLE></DIV>
<DIV align=center>
<TABLE border=0 cellSpacing=0 height=237 width=750>
<TBODY>
<TR>
<TD height=%100 vAlign=top width=590>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD width="100%">
<P align=center><SPAN class=title>用ASP實現網上“五子棋”大賽</SPAN> </P></TD></TR>
<TR>
<TD width="100%"><IMG height=5
src="用ASP網上“五子棋”大 - 者網摘.files/space.gif" width=1></TD></TR>
<TR>
<TD vAlign=center width="100%">
<DIV align=center>愛網無限 11-08-2001 20:27:35 閱讀623次 <SPAN
title=已經沒有了>上一篇</SPAN> <SPAN><A
href="http://www.meetchinese.com/earticles/show.cgi?id=904"
title=ASP制作每天更新的全國24小時天氣預報>下一篇</A></SPAN></DIV></TD></TR>
<TR>
<TD vAlign=center width="100%"><IMG height=5
src="用ASP網上“五子棋”大 - 者網摘.files/space.gif" width=1></TD></TR>
<TR>
<TD bgColor=#808080 width="100%"><IMG height=1
src="用ASP網上“五子棋”大 - 者網摘.files/space.gif" width=1></TD></TR>
<TR>
<TD width="100%"><IMG height=5
src="用ASP網上“五子棋”大 - 者網摘.files/space.gif" width=1></TD></TR>
<TR>
<TD class=text width="100%">
“五子棋”是大家都非常熟悉的一種益智類游戲,相關的游戲軟件也非常多,在此我向大家隆重推出一款新的純“網絡版”的五子棋,它利用ASP做為開發環境,因此在Internet上對戰的時候無需下載客戶端軟件,只要你有一個瀏覽器就可以了。你也可以在局域網上進行這個游戲。
<BR><BR> 對于ASP,我不想做過多的說明,在以前的文章中,我已經說過很多。 <BR><BR>
游戲的過程是這樣的,我們首先登錄,然后可以選擇戰場,有“金星”、“木星”、“水星”、“火星”、“土星”等五個戰場,如果你自認為是一個高手,可以選擇金星,否則可以依次選擇其它幾個星球做為戰場。如果這個星球上沒有擂主,你就應該以擂主的身份進入,然后別人就可以和你進行對戰了。當然,如果所有的星球上都已經開始了戰爭,那么你就只能等一會兒了。
<BR><BR>
如果你是以擂主身份進入的,你可以等待別人來和你對戰,如果你是以攻擂手的身份登錄,你可以很快的和擂主展開戰斗。開始戰斗后,由擂主執黑先行,然后由攻擂手出招,如此這般。當最后決出勝負的時候,會有相應的提示。
<BR><BR>該站點有幾個主要的文件是: <BR><BR>Index.asp 登錄文件:
<BR><BR>Index0.asp中間文件: <BR><BR>Match.asp 比賽文件: <BR><BR>
Back0.jpg white0.jpg black0.jpg 中間用到的圖形文件,分別指的棋盤,白子和黑子,如下圖:
<BR><BR>在程序的初始化的時候,將棋盤上分成若干的表格,將背景圖片放入其中,形成一個棋盤,然后在放上一個棋子后,再將圖片換上相應的白子或黑子就可以了。
<BR><BR>先看看登錄文件: <BR><BR><%@ Language=VBScript %>
<BR><BR><HTML> <BR><BR><HEAD> <BR><BR><META
NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<BR><BR><title>星球大戰之“五子連珠”大賽!</title>
<BR><BR></HEAD> <BR><BR><BODY> <BR><BR> <BR><BR><p
align=center><font size=6>星球大戰</font></P>
<BR><BR><table border=1 width=80% align=center>
<BR><BR><tr><td>星球</td><td>擂主</td><td>大戰</td><td>攻擂</td></tr>
<BR><BR><tr> <BR><BR><td>金星</td>
<BR><BR><td> <BR><BR><% <BR><BR>if application("first1")=""
then <BR><BR>%> <BR><BR><form action=index0.asp?flag=First1
method=post> <BR><BR><INPUT id=text1 name=txtFirst1
size=10><INPUT id=submit1 name=submit1 <BR>type=submit
value=進入> <BR><BR></form> <BR><BR><% <BR><BR>else
<BR><BR>response.write application("first1") <BR><BR>end if
<BR><BR>%> <BR><BR></td> <BR><BR><td>大戰</td>
<BR><BR><td> <BR><BR><% <BR><BR>if
application("second1")="" then <BR><BR>%> <BR><BR>
<BR><BR><form action=index0.asp?flag=second1 method=post>
<BR><BR><INPUT id=text1 name=txtSecond1 size=10><INPUT
id=submit1 <BR>name=submit1 type=submit value=進入>
<BR><BR></form> <BR><BR><% <BR><BR>else
<BR><BR>response.write application("Second1") <BR><BR>end if
<BR><BR>%> <BR><BR></td> <BR><BR></tr> <BR><BR>
<BR><BR><tr> <BR><BR><td>木星</td>
<BR><BR><td> <BR><BR><% <BR><BR>if application("first2")=""
then <BR><BR>%> <BR><BR><form action=index0.asp?flag=First2
method=post> <BR><BR><INPUT id=text1 name=txtFirst2
size=10><INPUT id=submit1 name=submit1 <BR>type=submit
value=進入> <BR><BR></form> <BR><BR><% <BR><BR>else
<BR><BR>response.write application("first2") <BR><BR>end if
<BR><BR>%> <BR><BR></td> <BR><BR><td>大戰</td>
<BR><BR><td> <BR><BR><% <BR><BR>if
application("second2")="" then <BR><BR>%> <BR><BR>
<BR><BR><form action=index0.asp?flag=second2 method=post>
<BR><BR><INPUT id=text1 name=txtSecond2 size=10><INPUT
id=submit1 <BR>name=submit1 type=submit value=進入>
<BR><BR></form> <BR><BR><% <BR><BR>else
<BR><BR>response.write application("Second2") <BR><BR>end if
<BR><BR>%> <BR><BR></td> <BR><BR></tr> <BR><BR>
<BR><BR><tr> <BR><BR><td>金星</td>
<BR><BR><td> <BR><BR><% <BR><BR>if application("first3")=""
then <BR><BR>%> <BR><BR><form action=index0.asp?flag=First3
method=post> <BR><BR><INPUT id=text1 name=txtFirst3
size=10><INPUT id=submit1 name=submit1 <BR>type=submit
value=進入> <BR><BR></form> <BR><BR><% <BR><BR>else
<BR><BR>response.write application("first3") <BR><BR>end if
<BR><BR>%> <BR><BR></td> <BR><BR><td>大戰</td>
<BR><BR><td> <BR><BR><% <BR><BR>if
application("second3")="" then <BR><BR>%> <BR><BR>
<BR><BR><form action=index0.asp?flag=second3 method=post>
<BR><BR><INPUT id=text1 name=txtSecond3 size=10><INPUT
id=submit1 <BR>name=submit1 type=submit value=進入>
<BR><BR></form> <BR><BR><% <BR><BR>else
<BR><BR>response.write application("Second3") <BR><BR>end if
<BR><BR>%> <BR><BR></td> <BR><BR></tr> <BR><BR>
<BR><BR><tr> <BR><BR><td>金星</td>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -