


Public static int board = new int // game board in 2D array Public static final int ROWS = 3, COLS = 3 // number of rows and columns Name-constants to represent the various states of the game Name-constants to represent the seeds and cell contents * All variables/methods are declared as static (belong to the class) * Tic-Tac-Toe: Two-player console, non-graphics, non-OO version. Player 'O', enter your move (row column): 2 1 Player 'X', enter your move (row column): 2 3 Player 'X', enter your move (row column): 2 2 This move at (2,2) is not valid.

Player 'O', enter your move (row column): 3 1 Player 'X', enter your move (row column): 1 3 Player 'O', enter your move (row column): 1 1 Let us start with a 2-player console (non-graphics) version of Tic-Tac-Toe, where player 'X' and player 'O' enter their moves successively, as shown below: Player 'X', enter your move (row column): 2 2 Let's Start with a 2-Player Console Non-OO Tic-Tac-Toe Visit each career track link to find out more.Ĭlick on the Image to run the Applet Demo (tested on FireFox/Windows only)ġ. We offer comprehensive self-paced and live training classes covering 60+ topics in the following four career tracks. If you are new to the field of Information Technology, you should take our below free course or check our IT Career Track Roadmap.
