求助:有个关于"游戏的玩法 "的程序考试题,如何编写?谢谢
求助:有个关于"游戏的玩法 "的程序考试题,如何编写?谢谢Playing the game will involve two steps. First, the user writes an X or an O in one cell and then presses the PLAY button. The program should then check if there is a winner. If yes, the message “Player X won!” or “Player O won!” should be displayed.
The game ends when a user has N number of X/O s on the same row, column or diagonal –where N is the size of the board.
For example, in all the following snapshots of the game, player X won (the character _ is used to denote that nothing was played in that cell):
Diagonal row column
X O _ O or X XXX or O _ X X
O X X O O _ O _ X O X X
_ _ X O _ O _ _ O O X O
_ _ _ X _ _ _ _ X O X O
[ 本帖最后由 ftyy 于 2011-4-21 11:59 编辑 ]