文件名称:five-chess
介绍说明--下载内容来自于网络,使用问题请自行百度
(1)首先调用Chessboard 类型的chessboard 属性中的initBoard()与printBoard()方法去初始
化与打印棋盘。
(2)从控制台获取用户的输入。
(3)再调用本类的isValid()方法去验证玩家输入的合法性,如果输入不合法,返回第2 步继续,
否则到第4 步。
(4)把玩家下的棋子位置赋值为 ● 。
(5)调用isWon( int posX , int posY , String chessman )判断玩家是否赢了。如果玩家赢了,
则调用isReply()方法输出的信息询问玩家是否重新游戏,如果玩家输入y,则返回第1 步重新
开始。
(6)调用computerDo()方法随机生成计算机的x,y 坐标,并把board[x][y] 赋值为 ○ 。如果
计算机赢了,则调用isReply()方法输出的信息询问玩家是否重新游戏,如果玩家输入y,则返
回第1 步重新开始,否则返回第2 步轮到用户输入。-(1) The first call Chessboard type chessboard properties initBoard () and printBoard () method to initialize and print the board. (2) to obtain user input the console. (3) and then call this class isValid () method to verify the legitimacy of player input, if the input is not valid, return to step 2 to continue, otherwise to step 4. (4) under the pawn position players assigned to " ●" . (5) calls isWon (int posX, int posY, String chessman) to determine whether the player wins. If the player wins, then call isReply () method outputs information to re-ask the players if the game, if a player enter y, then return to step 1 and start again. (6) calling computerDo () method of a computer generated random x, y coordinates, and the board [x] [y] is assigned " ○" . If the computer wins, then call isReply () method outputs information to re-ask the players if the game, if a player enter y, then return to step 1 to start again, otherw
化与打印棋盘。
(2)从控制台获取用户的输入。
(3)再调用本类的isValid()方法去验证玩家输入的合法性,如果输入不合法,返回第2 步继续,
否则到第4 步。
(4)把玩家下的棋子位置赋值为 ● 。
(5)调用isWon( int posX , int posY , String chessman )判断玩家是否赢了。如果玩家赢了,
则调用isReply()方法输出的信息询问玩家是否重新游戏,如果玩家输入y,则返回第1 步重新
开始。
(6)调用computerDo()方法随机生成计算机的x,y 坐标,并把board[x][y] 赋值为 ○ 。如果
计算机赢了,则调用isReply()方法输出的信息询问玩家是否重新游戏,如果玩家输入y,则返
回第1 步重新开始,否则返回第2 步轮到用户输入。-(1) The first call Chessboard type chessboard properties initBoard () and printBoard () method to initialize and print the board. (2) to obtain user input the console. (3) and then call this class isValid () method to verify the legitimacy of player input, if the input is not valid, return to step 2 to continue, otherwise to step 4. (4) under the pawn position players assigned to " ●" . (5) calls isWon (int posX, int posY, String chessman) to determine whether the player wins. If the player wins, then call isReply () method outputs information to re-ask the players if the game, if a player enter y, then return to step 1 and start again. (6) calling computerDo () method of a computer generated random x, y coordinates, and the board [x] [y] is assigned " ○" . If the computer wins, then call isReply () method outputs information to re-ask the players if the game, if a player enter y, then return to step 1 to start again, otherw
(系统自动生成,下载前可以参看下载内容)
下载文件列表
five chess.docx
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.