user.java

来自「This the OXO example code plus the prese」· Java 代码 · 共 36 行

JAVA
36
字号
/** * Write a description of class User here. *  * @author (your name)  * @version (a version number or a date) */public class User{    Board board;    String playPiece;    /**     * Constructor for objects of class User     */    public User(Board board, String playPiece)    {        this.board = board;        this.playPiece = playPiece;    }	/**	 *  Updates the	internal state of the game by 	 *	placing the current move string in the correct board cell	 *		 * @param	squareNumber  range 0 to 8, used to identify the button	 */	public void move(int squareNumber )	{		int r = squareNumber / 3;		int c = squareNumber % 3;		Coord coord = new Coord(r,c);		board.setCell( coord, playPiece);	}}

⌨️ 快捷键说明

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