tictactoeboard.java

来自「java 完全探索的随书源码」· Java 代码 · 共 43 行

JAVA
43
字号
import java.net.*;import java.io.*;public class TicTacToeBoard{  private String[] board = new String[9];  public TicTacToeBoard()  {    super();  }  public boolean isWinning()  {    // The algorithm here to see if any combination is a winner    // return some value for now    return false;  }  public TicTacToeMoveResult addNewMove( TicTacToeMove nextMove )  {    // validate the move for the client and return a result    return new TicTacToeMoveResult();  }  public void sendObject( TicTacToeMove move, Socket socket )  {    try    {      ObjectOutputStream outStr = new ObjectOutputStream( socket.getOutputStream() );      outStr.writeObject( move );    }    catch( InvalidClassException ex )    {      ex.printStackTrace();    }    catch( IOException ex )    {      ex.printStackTrace();    }  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?