java+国际象棋+源码_Java-International-chess - 源码下载|游戏|其他智力游戏|源代码 - 源码中国...

.classpath

.DS_Store

.project

.settings

.........\org.eclipse.jdt.core.prefs

bin

...\.classpath

...\CapturedPlacePanel.class

...\ChessBoard.class

...\ChessGame.class

...\ChessGrid.class

...\Chessman.class

...\ChessmanButton.class

...\ChessModel.class

...\ChessName.class

...\ChessRules.class

...\Location.class

...\MainGUI.class

...\Player.class

...\TipPanel.class

pictures

........\Black.gif

........\blackbishop.png

........\blackking.png

........\blackknight.png

........\blackpawn.png

........\blackqueen.png

........\blackrook.png

........\White.gif

........\whitebishop.png

........\whiteking.png

........\whiteknight.png

........\whitepawn.png

........\whitequeen.png

........\whiterook.png

src

...\CapturedPlacePanel.java

...\ChessBoard.java

...\ChessGame.java

...\ChessGrid.java

...\Chessman.java

...\ChessmanButton.java

...\ChessModel.java

...\ChessName.java

...\ChessRules.java

...\Location.java

...\MainGUI.java

...\Player.java

...\TipPanel.java

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
一个可以进行网络对战的国际象棋码。这个程序可以换棋子和棋盘,还有聊天、以applet运行等功能,非常不错!!<br><br>一、用ant编译码(所有文件及目录结构请下载)<br><br>C:\cs>ant compile<br>Buildfile: build.xml<br><br>compile:<br>[mkdir] Created dir: C:\cs\build<br>[javac] Compiling 60 source files to C:\cs\build<br>[javac] Note: * uses or overrides a deprecated API.<br>[javac] Note: Recompile with -Xlint:deprecation for details.<br>[javac] Note: Some input files use unchecked or unsafe operations.<br>[javac] Note: Recompile with -Xlint:unchecked for details.<br><br>BUILD SUCCESSFUL<br>Total time: 14 seconds<br><br> <br><br>二、在命令行启动服务端<br><br>C:\cs>java com.borland.samples.chess.server.ChessServer<br>05-12-28 下午09时44分43秒 CST<br>Read 2 userId records from C:\cs\users.obj<br>Hello 8889<br>Address of the Server :microsof-0f0cfb/127.0.0.1<br>HelloThread: Waiting for someone to talk to me on port 8889<br><br>三、打开两个dos窗口,在命令行分别启动两个客户端程序,每一个客户端程序都会弹出登录对话框,请输入你的姓名和口令登录。如其中之一<br><br>C:\cs>java com.borland.samples.chess.client.ChessViewer<br>imageName = images/cmpieces.gif<br>imageName = images/owlpieces.gif<br>imageName = images/ibmpieces.gif<br>no file specified<br>ImageFactory.square size = 49 pieces=23671010<br>CV8889Received: 8890<br>ClientSender:Name with 2 parameters<br>ClientSender:List with 0 parameters<br>ClientSender:AdjuornedList with 0 parameters<br><br><br> <br>
def __next_step(self, x, y): if not self.judge_colory: self.__history += 0 else: self.__history += 1 self.color = 1 if self.__history % 2 == 0 else 2 if self.start_ai_game: if self.ai_color == self.color: row,col = self.ai_stage(self.ai_game()[0],self.ai_game()[1]) else: col = round((x-self.__margin*2)/self.__cell_width) row = round((y-self.__margin*2)/self.__cell_width) stage_row = (y-self.__margin)-(self.__cell_width*row+self.__margin) stage_col = (x-self.__margin)-(self.__cell_width*col+self.__margin) if stage_col < stage_row: self.direct= 1 else: self.direct= 0 else: col = round((x - self.__margin * 2) / self.__cell_width) row = round((y - self.__margin * 2) / self.__cell_width) stage_row = (y - self.__margin) - (self.__cell_width * row + self.__margin) stage_col = (x - self.__margin) - (self.__cell_width * col + self.__margin) if stage_col < stage_row: self.direct = 1 else: self.direct= 0 if self.valide(row, col, self.direct): if self.__history % 4 == 0 or (self.__history + 2) % 4 == 0: self.__game_board.drew_turn(2) else: self.__game_board.drew_turn(1) self.add_logic(row, col, self.color) self.__game_board.draw_chess(row, col, self.color, self.direct) if self.judge_owner(row, col, self.color, self.direct): self.__game_board.drew_turn(self.judge_next(self.color)) for i in self.judge_owner(row, col, self.color, self.direct): x,y=self.draw_owner(i) self.__game_board.drew_owner(self.color, y, x) else: self.__game_board.drew_turn(self.color) self.judge_color(row, col, self.color, self.direct) print(self.logic_board_state) if 0 not in self.logic_board_owner: self.__game_board.pop_win(self.judge_winner())
07-14

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值