五子棋java代码 javafx五子棋游戏(12)


chessLinkTest++;
else
break;
}
chessLink=1;
chessLinkTest=1;
for(step=1;step=4;step++)
{
for(chessCompare=0;chessCompare=chessBlackCount;chessCompare++)
{
if((a*20==chessBlack_x[chessCompare])((b+step)*20==chessBlack_y[chessCompare]))
{
chessLink++;
if(chessLink==5)
{
return(true);
}
}
}
if(chessLink==(chessLinkTest+1))
chessLinkTest++;
else
break;
}
for(step=1;step=4;step++)
{
for(chessCompare=0;chessCompare=chessBlackCount;chessCompare++)
{
if((a*20==chessBlack_x[chessCompare])((b-step)*20==chessBlack_y[chessCompare]))
{
chessLink++;
if(chessLink==5)
{
return(true);
}
}
}
if(chessLink==(chessLinkTest+1))
chessLinkTest++;
else
break;
}
chessLink=1;
chessLinkTest=1;
for(step=1;step=4;step++)
{
for(chessCompare=0;chessCompare=chessBlackCount;chessCompare++)
{
if(((a-step)*20==chessBlack_x[chessCompare])((b+step)*20==chessBlack_y[chessCompare]))
{
chessLink++;
if(chessLink==5)
{
return(true);
}
}
}
if(chessLink==(chessLinkTest+1))
chessLinkTest++;
else
break;
}
for(step=1;step=4;step++)
{
for(chessCompare=0;chessCompare=chessBlackCount;chessCompare++)
{
if(((a+step)*20==chessBlack_x[chessCompare])((b-step)*20==chessBlack_y[chessCompare]))
{
chessLink++;
if(chessLink==5)
{
return(true);
}
}
}
if(chessLink==(chessLinkTest+1))
chessLinkTest++;
else
break;
}
chessLink=1;
chessLinkTest=1;
for(step=1;step=4;step++)
{
for(chessCompare=0;chessCompare=chessBlackCount;chessCompare++)
{
if(((a+step)*20==chessBlack_x[chessCompare])((b+step)*20==chessBlack_y[chessCompare]))
{
chessLink++;
if(chessLink==5)
{
return(true);
}
}
}
if(chessLink==(chessLinkTest+1))
chessLinkTest++;
else
break;
}
for(step=1;step=4;step++)
{
for(chessCompare=0;chessCompare=chessBlackCount;chessCompare++)
{
if(((a-step)*20==chessBlack_x[chessCompare])((b-step)*20==chessBlack_y[chessCompare]))
{
chessLink++;
if(chessLink==5)
{
return(true);
}
}
求java五子棋代码要注释~现在1小时等待package org.crazyit.gobang;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/**
* 五子棋游戏类
*
* @author yangenxiong yangenxiong2009@gmail.com
* @author Kelvin Mak kelvin.mak125@gmail.com
* @version1.0
* br/网站: a href=""疯狂Java联盟/a
* brCopyright (C), 2009-2010, yangenxiong
* brThis program is protected by copyright laws.
*/
public class GobangGame {
// 定义达到赢条件的棋子数目
private final int WIN_COUNT = 5;
// 定义用户输入的X坐标
private int posX = 0;
// 定义用户输入的X坐标
private int posY = 0;
// 定义棋盘
private Chessboard chessboard;
/**
* 空构造器
*/
public GobangGame() {
}
/**
* 构造器,初始化棋盘和棋子属性
*
* @param chessboard
*棋盘类
*/
public GobangGame(Chessboard chessboard) {
this.chessboard = chessboard;
}
/**
* 检查输入是否合法 。
*
* @param inputStr
*由控制台输入的字符串 。
* @return 字符串合法返回true,反则返回false 。
*/
public boolean isValid(String inputStr) {
// 将用户输入的字符串以逗号(,)作为分隔 , 分隔成两个字符串

推荐阅读