热门标签
更多>
搜索结果
查询Tags标签: TicTacToe,共有 2条记录-
348. Design Tic-Tac-Toe
class TicTacToe {int n;int[] rows;int[] cols;int diag=0;int antiDiag = 0;public TicTacToe(int n) {this.n = n;rows = new int[n];cols = new int[n];}public int move(int row, int col, int player) {int add = 1;if(player!=1)add = -1;rows[row]+=add;cols[col]…
2022/4/14 6:12:44 人评论 次浏览 -
C++实现井字棋游戏
C++实现井字棋游戏#include<iostream> #include<cstdlib> #include<cstdio> using namespace std;class TicTacToe { private:char currentPlayer;char board[3][3]; public:TicTacToe();void print();char getCurrentPlayer();char getWinner();bool i…
2022/1/30 17:05:30 人评论 次浏览