⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oxogame.java

📁 This the OXO example code plus the presentation. It is intended to provide you with some clues about
💻 JAVA
字号:
/** * Contains the key elements for playing a game of noughts and crosses . *  * @author Ian Bradley  * @version 1.0 March 2008 */public class OXOGame{    // instance variables - replace the example below with your own    private Board board;    private String turn;    private User user;    private ComputerPlayer computer;    /**     * Constructor for objects of class OXOGame     *      */    public OXOGame()    {        board = new Board();        computer = new ComputerPlayer(board, "X");        user = new User(board, "O");    }        public void userUpdate(int square)    {                                user.move(square);    }        public Coord computerUpdate()    {       return computer.move();    }                public boolean checkForWin()    {        return board.checkWin();    }      public boolean checkForSpace()    {        return board.stillSpace();    }        }

⌨️ 快捷键说明

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