做了一个Ajax象棋,大家帮我测试一下http://www.dullwolf.cn/Chess/,对于提供有效的测试朋友,可以赠送原代码谢谢!~~

超级大笨狼 2008-07-13 06:59:37
做了一个Ajax象棋,棋力还可以,一般业余水平的人下不过服务器,大家帮我测试一下.
http://www.dullwolf.cn/Chess/

我的MSN:panyuguang962@hotmail.com

希望能描述清楚Bug发生的状况,因为测试太辛苦了,很难重现和推断出问题所在,所以
对于提供有效的测试朋友,表示万分感谢,可以在调试基本稳定后赠送原代码.

谢谢!~~
...全文
2073 171 打赏 收藏 转发到动态 举报
写回复
用AI写文章
171 条回复
切换为时间正序
请发表友善的回复…
发表回复
超级大笨狼 2008-07-22
  • 打赏
  • 举报
回复
[Quote=引用 59 楼 superdullwolf 的回复:]
由于工作忙,没时间经营

服务器找人共用。

配置:
CPU:奔4酷瑞双核3.4G
内存:2G
硬盘:250G
共享百兆(机柜只有4台机器)。
怒江移动机房,南北双通,南北方速度都快
wolf.pan@kuq.com

价格可商量
[/Quote]
邮箱联系:panyuguang962@hotmail.com
alisafan123 2008-07-22
  • 打赏
  • 举报
回复
[Quote=引用 10 楼 namhyuk 的回复:]
cool! REALLY cool!
[/Quote]
leixueqiyi 2008-07-22
  • 打赏
  • 举报
回复
点中自己一方所有的棋,等到改变颜色后,用自己的棋覆盖自己的棋
程序停止比如用炮覆盖自己的兵
licq95 2008-07-22
  • 打赏
  • 举报
回复
只不过几次中有一次是那样地,后来开棋直接把红帅拿到黑将上面,居然两个老将坐一个位置上可以和平相处,
然后再把红帅请回来就难了,但是可以继续下棋,就是红帅的位置上是空的,两个老将跑一个被窝里啦。
licq95 2008-07-22
  • 打赏
  • 举报
回复
有bug ,我开棋直接把红帅压到黑将上边,对话框就提示我赢了
licq95 2008-07-22
  • 打赏
  • 举报
回复
好像比中国象棋2000的算法还要先进
nicholsky 2008-07-22
  • 打赏
  • 举报
回复
上周就玩了,但有个问题,为什么马在将军的时候可以不扮马脚直接吃的,象棋中有这规矩?上次就这样输了。
cwb210 2008-07-22
  • 打赏
  • 举报
回复
UP
超级大笨狼 2008-07-21
  • 打赏
  • 举报
回复
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Wall._Default" %>

<!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 runat="server">
<title>Untitled Page</title>
<style>
td{border:1px solid black;width:10px;height:10px;}

</style>
<script>
var maxX=<%=maxX %>;
function d(x,y)
{
var td1=document.getElementById("td" +x );
var tdx=document.getElementById("td" +y );
if(y==x+1)
{
td1.style.borderLeftColor="white";
td2.style.borderRightColor="white";

}
if(y==x+maxX)
{
td1.style.borderTopColor="white";
td2.style.borderBottomColor="white";
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
X:
<asp:TextBox ID="TextBox1" runat="server" Text="80"></asp:TextBox>
Y:
<asp:TextBox ID="TextBox2" runat="server" Text="50"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="确定" />
<table id="tb" style="border-collapse:collapse;">
<%=HTML.ToString()%>
</table>
<script>
<%=SCRIPT.ToString()%>
</script>
</form>
</body>
</html>
超级大笨狼 2008-07-21
  • 打赏
  • 举报
回复
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;

namespace Wall
{
public partial class _Default : System.Web.UI.Page
{
protected StringBuilder HTML = new StringBuilder();
protected StringBuilder SCRIPT = new StringBuilder();
private List<List<int>> totalWays = new List<List<int>>();
private Dictionary<string, bool> allWalls = new Dictionary<string, bool>();
private Dictionary<string, bool> deleteWalls = new Dictionary<string, bool>();
protected int maxX;
protected int maxY;
protected void Page_Load(object sender, EventArgs e)
{
HTML.Append("");
maxX = Convert.ToInt32(this.TextBox1.Text);
maxY = Convert.ToInt32(this.TextBox2.Text);

for (int y = 0; y < maxY; y++)
{
HTML.Append("<tr>" );
for (int x = 1; x <= maxX; x++)
{
int id = x + y * maxX;
List<int> room = new List<int>();
room.Add(id);
totalWays.Add(room);
string theWall = makeWall(id, id + 1);
if (x < maxX) { allWalls.Add(theWall,true); }
theWall = makeWall(id, id + maxX);
if (y < maxY) { allWalls.Add(theWall, true); }
HTML.Append("<td id=td" + id + ">" + " <td/>");
}
HTML.Append("</tr>");
}
while (totalWays.Count > 1)
{
makePuzzle();
}
foreach (string Key in deleteWalls.Keys)
{
SCRIPT.Append("d(" + Key + ");");
}


}
private void makePuzzle()
{

//随机在全部中选择一个回廊
int firstChoice = randomInt(totalWays.Count);
//列出该回廊全部相关回廊;
List<int> firstChoiceWay = totalWays[firstChoice];
List<List<int>> tempWay = new List<List<int>>();
for (int i = 0; i < totalWays.Count; i++)
{
if (i != firstChoice)
{
if (isNeighbor(firstChoiceWay, totalWays[i]))
{
tempWay.Add(totalWays[i]);
}
}
}
//随机在totalWays中选择一个回廊
int secondChoice = randomInt(tempWay.Count);
List<int> secondCoiceWay = tempWay[secondChoice];
//得到2者间全部可以拆的墙
List<string> tempWalls = new List<string>();
for (int i = 0; i < firstChoiceWay.Count; i++)
{
for (int j = 0; j < secondCoiceWay.Count; j++)
{
if (IsExsists(firstChoiceWay[i], secondCoiceWay[j]))
{
tempWalls.Add(makeWall(firstChoiceWay[i], secondCoiceWay[j]));
}
}
}
int thirdChoice = randomInt(tempWalls.Count);
string theWall = tempWalls[thirdChoice];
//纪录拆墙办法
deleteWalls.Add(theWall,true);
//增加一个新的
List<int> newWay = new List<int>();
newWay .AddRange(firstChoiceWay);
newWay.AddRange(secondCoiceWay);
totalWays.Add(newWay);
//移掉2个
totalWays.Remove(firstChoiceWay);
totalWays.Remove(secondCoiceWay);
}

private string makeWall(int x, int y)
{
int first = Min(x, y);
int second = Max(x,y);
return first.ToString() + "," + second;
}
private int randomInt(int input)
{
Random rand = new Random();
//随机在全部中选择一个
//得到回廊的回廊
if (input == 0)
{
return 0;
}
else
{
return rand.Next(0, input);
}
}


/// <summary>
/// 判断两个集合是否是邻居
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
private bool isNeighbor(List<int> a, List<int> b)
{
bool re = false;
for (int i = 0; i < a.Count; i++)
{
for (int j = 0; j < b.Count; j++)
{
if (IsExsists(a[i], b[j]))
{
re = true;
break;
}
}
if (re) { break; }
}
return re;
}
private bool IsExsists(int x, int y)
{
bool re = false;
if (Math.Abs(x-y) == 1 || Math.Abs(x- y) == maxX)
{
string theWall = makeWall(x,y);
if (allWalls.ContainsKey(theWall))
{
re = true;
}
}
return re;
}

private int Max(int x, int y)
{
if (x > y) { return x; } else { return y; }
}
private int Min(int x, int y)
{
if (x < y) { return x; } else { return y; }
}



}

}
超级大笨狼 2008-07-21
  • 打赏
  • 举报
回复
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;

namespace Wall
{
public partial class _Default : System.Web.UI.Page
{
protected StringBuilder HTML = new StringBuilder();
protected StringBuilder SCRIPT = new StringBuilder();
private List<List<int>> totalWays = new List<List<int>>();
private Dictionary<string, bool> allWalls = new Dictionary<string, bool>();
private Dictionary<string, bool> deleteWalls = new Dictionary<string, bool>();
protected int maxX;
protected int maxY;
protected void Page_Load(object sender, EventArgs e)
{
HTML.Append("");
maxX = Convert.ToInt32(this.TextBox1.Text);
maxY = Convert.ToInt32(this.TextBox2.Text);

for (int y = 0; y < maxY; y++)
{
HTML.Append("<tr>" );
for (int x = 1; x <= maxX; x++)
{
int id = x + y * maxX;
List<int> room = new List<int>();
room.Add(id);
totalWays.Add(room);
string theWall = makeWall(id, id + 1);
if (x < maxX) { allWalls.Add(theWall,true); }
theWall = makeWall(id, id + maxX);
if (y < maxY) { allWalls.Add(theWall, true); }
HTML.Append("<td id=td" + id + ">" + " <td/>");
}
HTML.Append("</tr>");
}
while (totalWays.Count > 1)
{
makePuzzle();
}
foreach (string Key in deleteWalls.Keys)
{
SCRIPT.Append("d(" + Key + ");");
}


}
private void makePuzzle()
{

//随机在全部中选择一个回廊
int firstChoice = randomInt(totalWays.Count);
//列出该回廊全部相关回廊;
List<int> firstChoiceWay = totalWays[firstChoice];
List<List<int>> tempWay = new List<List<int>>();
for (int i = 0; i < totalWays.Count; i++)
{
if (i != firstChoice)
{
if (isNeighbor(firstChoiceWay, totalWays[i]))
{
tempWay.Add(totalWays[i]);
}
}
}
//随机在totalWays中选择一个回廊
int secondChoice = randomInt(tempWay.Count);
List<int> secondCoiceWay = tempWay[secondChoice];
//得到2者间全部可以拆的墙
List<string> tempWalls = new List<string>();
for (int i = 0; i < firstChoiceWay.Count; i++)
{
for (int j = 0; j < secondCoiceWay.Count; j++)
{
if (IsExsists(firstChoiceWay[i], secondCoiceWay[j]))
{
tempWalls.Add(makeWall(firstChoiceWay[i], secondCoiceWay[j]));
}
}
}
int thirdChoice = randomInt(tempWalls.Count);
string theWall = tempWalls[thirdChoice];
//纪录拆墙办法
deleteWalls.Add(theWall,true);
//增加一个新的
List<int> newWay = new List<int>();
newWay .AddRange(firstChoiceWay);
newWay.AddRange(secondCoiceWay);
totalWays.Add(newWay);
//移掉2个
totalWays.Remove(firstChoiceWay);
totalWays.Remove(secondCoiceWay);
}

private string makeWall(int x, int y)
{
int first = Min(x, y);
int second = Max(x,y);
return first.ToString() + "," + second;
}
private int randomInt(int input)
{
Random rand = new Random();
//随机在全部中选择一个
//得到回廊的回廊
if (input == 0)
{
return 0;
}
else
{
return rand.Next(0, input);
}
}


/// <summary>
/// 判断两个集合是否是邻居
/// </summary>
/// <param name="a"></param>
/// <param name="b"></param>
/// <returns></returns>
private bool isNeighbor(List<int> a, List<int> b)
{
bool re = false;
for (int i = 0; i < a.Count; i++)
{
for (int j = 0; j < b.Count; j++)
{
if (IsExsists(a[i], b[j]))
{
re = true;
break;
}
}
if (re) { break; }
}
return re;
}
private bool IsExsists(int x, int y)
{
bool re = false;
if (Math.Abs(x-y) == 1 || Math.Abs(x- y) == maxX)
{
string theWall = makeWall(x,y);
if (allWalls.ContainsKey(theWall))
{
re = true;
}
}
return re;
}

private int Max(int x, int y)
{
if (x > y) { return x; } else { return y; }
}
private int Min(int x, int y)
{
if (x < y) { return x; } else { return y; }
}



}

}
binglingshui 2008-07-21
  • 打赏
  • 举报
回复
老大,给你顶贴呀。
回头我跟饭饭用SL给你做个界面。

呵呵。
超级大笨狼 2008-07-19
  • 打赏
  • 举报
回复
to:yulusilian1
可能是炮的步法有错误,周一我再检查一下.
哈皮玩 2008-07-19
  • 打赏
  • 举报
回复
我靠,竟然隔着卒子和我的象,炮把我的老帅给干沉了。汗!
哈皮玩 2008-07-19
  • 打赏
  • 举报
回复
如果有一个卒子过河了,恰好和另一个没过河得卒子“隔河相望”的话,那么没过河的卒子没办法往前走了。这步棋不违反规则啊。
xiao1zhao 2008-07-19
  • 打赏
  • 举报
回复
第1步:炮二平六 炮8平5
第2步:马二进三 马8进7
第3步:车一平二 车9进1
第4步:兵三进一 马2进3
第5步:兵七进一 车1进1
第6步:炮八平七 车1平4
第7步:仕六进五 车4进4
第8步:兵七进一 车4平2
第9步:马八进九 车2平3
第10步:兵七进一 车3进2
第11步:兵七进一 车3退5
第12步:车二进六 车3进2
第13步:车二平三 炮2平4
第14步:车九平八 车9平6
第15步:兵九进一 士6进5
第16步:相三进五

结果:笨狼想不出对策,算你赢了!重来吗?

说明问题:
1.陷入僵局情况下可考虑兑子,优先顺序为兑子为卒、炮、马、车;

2.或走闲棋,如绊马腿、塞象眼、攻卒、飞象等,甚至老将出马。
yutian130 2008-07-18
  • 打赏
  • 举报
回复
晕死,刚过河的兵一步走到顶了,要是一步把“将”吃了就好了
swort_177 2008-07-18
  • 打赏
  • 举报
回复
悔棋的话 对方回去了 自己的棋子却不回去!
超级大笨狼 2008-07-18
  • 打赏
  • 举报
回复
能拖又能点,加上了,但是可能不是很灵光
欢迎测试。
上班时间不能甩开膀子干,呵呵。
刚才传上去一个版本,简单测试还可以能拖又能点
shucaiguan 2008-07-18
  • 打赏
  • 举报
回复
要是能拖又能点好了.
服务器的算法是怎么做的呀?
加载更多回复(151)

7,765

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧