Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: NEED HELP WRITING METHODS FOR TIC-TAC-TOE PROGRAM

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation NEED HELP WRITING METHODS FOR TIC-TAC-TOE PROGRAM

    Hi!

    I am a beginner at Java in an Introduction to Computer Programming class. Our final project is to write a tic-tac-toe game for a program. I have included the requirements for the program and the skeletal code that my professor gave us. I commented out what needs to be written and what should be left alone. I am really horrible at Java coding so any help is much appreciated as I am struggling a lot. Thanks in advance!

    Directions:

    Tic-Tac-Toe Game

    Tic-tac-toe (or Noughts and crosses, Xs and Os) is a game for two players. Each player take turns marking the spaces in a 3x3 grid. The player who succeeds in placing three respective marks in a horizontal, vertical, or diagonal row wins the game. You can read the wikipedia page to learn more about the game.

    Also, you must play the games by yourself to understand the details. I have made three versions for your to play with (and eventually you have to implement them by yourself). The three versions are: random CPU player, smart CPU player, and smart CPU player with first-move.

    Required Funcionalities:
    When the user clicks on a legal square (not taken by players), mark the square as taken by user and save the board status to the 2-dimensional array gameboard; when the user clicks on an illegal square or somewhere else, do nothing.
    After the user makes a move, make a legal move automatically (or saying, by the computer player).
    Whenever the game ends and a player wins, highlight the winning row and display a message. Whenever the game ends as a draw, display a message. In either way, the game will be restarted after the next mouse click.
    Special Topic 1: Mouse Clicking

    You have been given method mouseDown() that detects mouse clicks and gets xx and y as the location of the mouse click. x and y will range from 0 to the size of the window. You will be using the Graphics class to display your game board. The window is 600 x 600 with (0,0) in the upper left corner. You should think of the board as a visual array with gameBoard[0][0] as the top left corner and each square is 200 x 200. To determine which square the user has selected you will need to convert the location of x and y to your array indices in setMouseSquare() method. There is a very easy way to do this without using if statements or switch statements. You will need to write a method that determines the current index location the user has selected.

    Coordinates range:

    index 0: 0 - 199
    index 1: 200 - 399
    index 2: 400 - 599

    Special Topic 2: Game Display

    Once you know which index the user has selected you will need to display a circle (or whatever shape you want) in the correct square on the board. You have had the experience of drawing circles in Lab 3 and Lab 5 (displaying Smiley). You can determine the location of your shape by multiplying and adding your current index by numbers. You will need to write a method that determins the exact position to draw circles.

    Special Topic 3: Generating Random Numbers

    The basic version of your AI will generate a random move (as long as it is legal). You can check the example here: random CPU player.

    A random integer can be generated by a random number generator. You can use it like this to get a random integer in the range from 0 to N-1:
    int N; // You can set its value
    Random generator = new Random();
    int randomNum = generator.nextInt(N);

    You need to use the random number to make a legal random move. There are many ways to do it.

    Special Topic 4: Smart Moves

    The advanced version of your AI will generate a smart move. You can check the example here: smart CPU player. Your grade in this part will be determined according to the "smartness" of your program. At least, your program should be able to:

    Make the winning move if the computer player can win in this move.
    Block the winning move if the human player can win in the next move.
    There are more rules that you can think of. It is possible to write a perfect AI that never lose. If you want to find a good opponent to test your program, use this example to play against your AI: smart CPU player with first-move

    Special Topic 5: Extra Points

    You receive extra 10 points if your CPUMove() method can work in CPU-first-move manner. You can change the paint() method to other names and change the CPUFirstpaint() method to paint() to let the computer player move first. Ideally, you don't have to write new strategies -- try to make the decision based on the current board instead of the current move.

    Code:

    import java.awt.Color;
    import java.awt.Event;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.util.Random;
     
    public class TicTacToe extends java.applet.Applet {
     
    	// Ignore this constant
    	private static final long serialVersionUID = 1942709821640345256L;
     
    	// You can change this boolean constant to control debugging log output
    	private static final boolean DEBUGGING = false;
     
    	// Constants
     
    	// Size of one side of the board in pixels
    	private static final int BOARD_SIZE_PIXELS = 600;
    	// Number of squares on one side of the board
    	private static final int SQUARES = 3;
    	// Diameter of the circle drawn in each square
    	private static final int CIRCLE_WIDTH = 90;
     
    	// Colors to be used in the game
    	private static final Color BACKGROUND_COLOR = Color.WHITE;
    	private static final Color SQUARE_BORDER_COLOR = Color.BLACK;
    	private static final Color GAME_OVER_MESSAGE_COLOR = Color.BLACK;
    	private static final Color HUMAN_COLOR = Color.RED;
    	private static final Color HUMAN_WINNING_COLOR = Color.MAGENTA;
    	private static final Color CPU_COLOR = Color.BLUE;
    	private static final Color CPU_WINNING_COLOR = Color.CYAN;
     
    	// Status constant values for the game board
    	private static final int EMPTY = 0;
    	private static final int HUMAN = 1;
    	private static final int HUMAN_WINNING = 2;
    	private static final int CPU = -1;
    	private static final int CPU_WINNING = -2;
     
    	// String displayed when the game ends
    	private static final String GAME_WIN_MESSAGE = "You win! Click to play again.";
    	private static final String GAME_LOSE_MESSAGE = "You lose......Click to play again.";
    	private static final String GAME_DRAW_MESSAGE = "No one wins? Click to play again...";
     
    	// Instance variables that control the game
     
    	// Whether or not the user just clicked the mouse
    	private boolean mouseClicked = false;
    	// Whether or not to start the game again
    	private boolean restart = false;
    	// Whether or not the CPU should start playing a move.
    	// USED ONLY WHEN THE CPU PLAYS FIRST!
    	private boolean onFirstMove = false;
    	// The column and row of the SQUARE the user clicked on
    	private int xMouseSquare; // column
    	private int yMouseSquare; // row
    	// The width (and height) of a single game square
    	private int squareWidth = BOARD_SIZE_PIXELS / SQUARES;
    	// An array to hold square status values on the board.
    	// The status values can be EMPTY, HUMAN, CPU or other values
    	private int[][] gameBoard;
    	// The column and row of the SQUARE the CPU player will move on
    	private int xCPUMove;
    	private int yCPUMove;
     
    	// Add the rest of your instance variables here, if you need any. (You won't
    	// need to, but you may if you want to.)
     
    	// Ignore these instance variables
     
    	// CPUinMove represents if the CPU is thinking (generating the CPU move).
    	// If it is true, it means the CPUMove() method is running and no new move
    	// should be added
    	private boolean CPUinMove;
     
    	// Methods that you need to write:
     
    	/*
    	 * Pre: x and y are x-coordinate and y-coordinate where the user just
    	 * clicks. squareWidth is the width (and height) of a single game square.
    	 * 
    	 * Post: xMouseSquare and yMouseSquare are set to be the column and row
    	 * where the user just clicked on (depending on x and y).
    	 * 
    	 * Hint: You need only two statements in this method.
    	 */
    	private void setMouseSquare(int x, int y) {
    		// TODO
    	}
     
    	/*
    	 * Pre: SQUARES is an int that holds the number of game squares along one
    	 * side of the game board. xSquare is an int such that 0 <= xSquare <
    	 * SQUARES. CIRCLE_WIDTH is an int that holds the diameter of the circle to
    	 * be drawn in the center of a square. squareWidth is an int that holds the
    	 * width and height in pixels of a single game square.
    	 * 
    	 * Post: Return the correct x-coordinate (in pixels) of the left side of the
    	 * circle centered in a square in the column xSquare.
    	 * 
    	 * Hint: This method should be very simple. What you need to do is to find
    	 * the right equation.
    	 */
    	private int getIconDisplayXLocation(int xSquare) {
    		// TODO
     
    		// This line is an example of using DEBUGGING variable
    		if (DEBUGGING) {
    			System.out.println("The input that getIconDisplayXLocation() receives is: " + xSquare);
    		}
     
    		// This line is just a placeholder. Replace it with your code.
    		return 0;
    	}
     
    	/*
    	 * Pre: SQUARES is an int that holds the number of game squares along one
    	 * side of the game board. ySquare is an int such that 0 <= ySquare <
    	 * SQUARES. CIRCLE_WIDTH is an int that holds the diameter of the circle to
    	 * be drawn in the center of a square. squareWidth is an int that holds the
    	 * width and height in pixels of a single game square.
    	 * 
    	 * Post: Return the correct y-coordinate (in pixels) of the top of the
    	 * circle centered in a square in the row ySquare.
    	 * 
    	 * Hint: This method should be very simple. What you need to do is to find
    	 * the right equation.
    	 */
    	private int getIconDisplayYLocation(int ySquare) {
    		// TODO
    		// This line is just a placeholder. Replace it with your code.
    		return 0;
    	}
     
    	/*
    	 * The instance variable gameBoard will be created and initialized
    	 * 
    	 * Pre: SQUARES is set to an int. gameBoard is a 2-dimensional array type
    	 * variable that holds the status of current game board. Each value in the
    	 * array represents a square on the board
    	 * 
    	 * Post: gameBoard must be assigned a new 2-dimensional array. Every square
    	 * of gameBoard should be initialized to EMPTY.
    	 * 
    	 * Hint: A loop.
    	 */
    	private void buildBoard() {
    		// TODO
    		// This line creates the gameBoard array. You must write several more
    		// lines to initialize all its values to EMPTY
    		gameBoard = new int[SQUARES][SQUARES];
    	}
     
    	/*
    	 * Returns whether the most recently clicked square is a legal choice in the
    	 * game.
    	 * 
    	 * Pre: gameBoard is a 2-dimensional array type variable that holds the
    	 * status of current game board. xSquare and ySquare represent the column
    	 * and row of the most recently clicked square.
    	 * 
    	 * Post: Returns true if and only if the square is a legal choice. If the
    	 * square is empty on current game board, it is legal and the method shall
    	 * return true; if it is taken by either human or CPU or it is not a square
    	 * on current board, it is illegal and the method shall return false.
    	 * 
    	 * Hint: Should be simple but think carefully to cover all cases.
    	 */
    	private boolean legalSquare(int xSquare, int ySquare) {
    		// TODO
    		// This line is just a placeholder. Replace it with your code.
    		return true;
    	}
     
    	/*
    	 * Pre: gameBoard is an array that holds the current status of the game
    	 * board. xSquare and ySquare represent the column and row of the most
    	 * recently clicked square. player represent the current player (HUMAN or
    	 * CPU). This method is always called after checking legalSquare().
    	 * 
    	 * Post: Set the square as taken by current player on the game board if the
    	 * square is empty.
    	 * 
    	 * Hint: Very simple.
    	 */
    	private void setMovePosition(int xSquare, int ySquare, int player) {
    		// TODO
    	}
     
    	/*
    	 * Check if HUMAN or CPU wins the game.
    	 * 
    	 * Pre: gameBoard is an array to hold square status values on the board. The
    	 * status values can be EMPTY, HUMAN, CPU or other values.
    	 * 
    	 * Post: The method will return true if and only if a player wins the game.
    	 * Winning a game means there is at least one row, one column, or one
    	 * diagonal that is taken by the same player. The method does not need to
    	 * indicate who wins because if it is implemented correctly, the winner must
    	 * be the one who just made a move.
    	 * 
    	 * Hint: Complicated method. Use loops to shorten your code. Think about how
    	 * to represent "a player takes 3 squares in a row/column/diagonal".
    	 */
     
    	private boolean gameEnd() {
    		// TODO
    		// This line is just a placeholder. Replace it with your code.
    		return false;
    	}
     
    	/*
    	 * Check if the game ends as a draw.
    	 * 
    	 * Pre: gameBoard is an array to hold square status values on the board. The
    	 * status values can be EMPTY, HUMAN, CPU or other values. This method is
    	 * always called after gameEnd().
    	 * 
    	 * Post: The method will return true if and only if all squares on the game
    	 * board are taken by HUMAN or CPU players (no EMPTY squares left).
    	 * 
    	 * Hint: Should be simple. Use loops.
    	 */
     
    	private boolean gameDraw() {
    		// TODO
    		// This line is just a placeholder. Replace it with your code.
    		return false;
    	}
     
    	/*
    	 * Marks circles on the line on which a player wins.
    	 * 
    	 * Pre: g is Graphics object that is ready to draw on. HUMAN_WINNING_COLOR
    	 * and CPU_WINNING_COLOR are both Color objects that represent the color to
    	 * show when HUMAN/CPU wins. gameBoard is gameBoard is an array to hold
    	 * square status values on the board. The status values can be EMPTY, HUMAN,
    	 * CPU or other values.
    	 * 
    	 * Post: ALL the row(s)/column(s)/diagonal(s) on which a player wins will be
    	 * marked as the special color.
    	 * 
    	 * Hint: You must draw a new circle with the special color (to replace the
    	 * old circle) on the square if the square belongs to a winning
    	 * row/column/diagonal. You can change gameBoard because the board will be
    	 * reset after displaying the winning line. You can use helper methods
    	 * (existing ones or your own) to finish this method. Pay attention that
    	 * many functions in this method is similar to gameEnd(). You should think
    	 * about reusing code.
    	 * 
    	 * Hint2: This method is not necessary for the game logic. You don't have to
    	 * start it early. Start when you know everything else is correct.
    	 */
     
    	private void markWinningLine(Graphics g) {
    		// TODO
    	}
     
    	/*
    	 * Generates the next square where the CPU plays a move.
    	 * 
    	 * Pre: gameBoard is gameBoard is an array to hold square status values on
    	 * the board. The status values can be EMPTY, HUMAN, CPU or other values.
    	 * 
    	 * Post: Set xCPUMove and yCPUMove to represent the column and the row which
    	 * CPU plans to play a move on. The respective square MUST BE EMPTY! It will
    	 * cause a logical error if this method returns a square that is already
    	 * taken!
    	 * 
    	 * Hint: Don't start too early -- currently this method works (though
    	 * naively). Make sure that everything else works before touching this
    	 * method!
    	 */
     
    	private void CPUMove() {
    		// TODO
    		// The following block gives a naive solution -- it finds the first
    		// empty square and play a move on it. You can use this method to test
    		// other methods in the beginning. However, you must replace this block
    		// with your own algorithms eventually.
    		for (int i = 0; i < SQUARES; i++) {
    			for (int j = 0; j < SQUARES; j++) {
    				if (gameBoard[i][j] == EMPTY) {
    					xCPUMove = i;
    					yCPUMove = j;
    					return;
    				}
    			}
    		}
    	}
     
    	/* Put any helper methods you wish to add here. */
     
    	/* You will not need to change anything below this line. */
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * Set the game board to show a new, blank game.
    	 */
    	private void wipeBoard(Graphics g) {
    		g.setColor(BACKGROUND_COLOR);
    		g.fillRect(0, 0, BOARD_SIZE_PIXELS, BOARD_SIZE_PIXELS);
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * Displays a circle on g, of the given color, in the center of the given
    	 * square.
    	 */
    	private void displayHit(Graphics g, Color color, int xSquare, int ySquare) {
    		g.setColor(color);
    		g.fillOval(getIconDisplayXLocation(xSquare),
    				getIconDisplayYLocation(ySquare), CIRCLE_WIDTH, CIRCLE_WIDTH);
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * This method handles mouse clicks. You will not need to call it.
    	 */
    	@Override
    	public boolean mouseDown(Event e, int xMouse, int yMouse) {
    		if (isClickable()) {
    			mouseClicked = true;
    			setMouseSquare(xMouse, yMouse);
    		}
    		repaint();
    		return true;
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * This method handles drawing the board. You will not need to call it.
    	 */
    	@Override
    	public void update(Graphics g) {
    		paint(g);
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * Draws the border between game squares onto canvas. Also, draws the moves
    	 * that are already made.
    	 */
    	private void displayGame(Graphics canvas) {
    		canvas.setColor(SQUARE_BORDER_COLOR);
    		for (int i = 0; i < BOARD_SIZE_PIXELS; i += squareWidth) {
    			for (int j = 0; j < BOARD_SIZE_PIXELS; j += squareWidth) {
    				canvas.drawRect(i, j, squareWidth, squareWidth);
    			}
    		}
    		for (int i = 0; i < SQUARES; i++) {
    			for (int j = 0; j < SQUARES; j++) {
    				switch (gameBoard[i][j]) {
    				case HUMAN:
    				case HUMAN_WINNING:
    					displayHit(canvas, HUMAN_COLOR, i, j);
    					break;
    				case CPU:
    				case CPU_WINNING:
    					displayHit(canvas, CPU_COLOR, i, j);
    					break;
    				default:
    					break;
    				}
    			}
    		}
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * This method relays information about the availability of mouse clicking
    	 * in the game. You will not need to call it.
    	 */
    	private boolean isClickable() {
    		return !CPUinMove;
    	}
     
    	/*
    	 * DO NOT change the contents this method.
    	 * 
    	 * If this method is changed to public void paint(Graphics canvas), it will
    	 * execute the program with the CPU-first order.
    	 * 
    	 * This method is like the "main" method (but for applets). You will not
    	 * need to call it. It contains most of the game logic.
    	 */
    	// @Override
    	public void CPUFirstpaint(Graphics canvas) {
    		displayGame(canvas);
    		if (mouseClicked) {
    			if (onFirstMove) {
    				CPUMove();
    				setMovePosition(xCPUMove, yCPUMove, CPU);
    				displayHit(canvas, CPU_COLOR, xCPUMove, yCPUMove);
    				onFirstMove = false;
    			} else {
    				if (restart) {
    					wipeBoard(canvas);
    					setUpGame();
    					repaint();
    				} else if (legalSquare(xMouseSquare, yMouseSquare)) {
    					setMovePosition(xMouseSquare, yMouseSquare, HUMAN);
    					displayHit(canvas, HUMAN_COLOR, xMouseSquare, yMouseSquare);
    					if (gameEnd()) {
    						markWinningLine(canvas);
    						canvas.setFont(new Font("SansSerif", Font.PLAIN, 30));
    						canvas.setColor(GAME_OVER_MESSAGE_COLOR);
    						canvas.drawString(GAME_WIN_MESSAGE, squareWidth / 2,
    								squareWidth);
    						restart = true;
    					} else {
    						CPUinMove = true;
    						CPUMove();
    						setMovePosition(xCPUMove, yCPUMove, CPU);
    						displayHit(canvas, CPU_COLOR, xCPUMove, yCPUMove);
    						CPUinMove = false;
    						if (gameEnd()) {
    							markWinningLine(canvas);
    							canvas
    									.setFont(new Font("SansSerif", Font.PLAIN,
    											30));
    							canvas.setColor(GAME_OVER_MESSAGE_COLOR);
    							canvas.drawString(GAME_LOSE_MESSAGE,
    									squareWidth / 2, squareWidth);
    							restart = true;
    						} else if (gameDraw()) {
    							canvas
    									.setFont(new Font("SansSerif", Font.PLAIN,
    											30));
    							canvas.setColor(GAME_OVER_MESSAGE_COLOR);
    							canvas.drawString(GAME_DRAW_MESSAGE,
    									squareWidth / 2, squareWidth);
    							restart = true;
    						}
    					}
    				}
    			}
    			mouseClicked = false;
    		}
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * This method is like the "main" method (but for applets). You will not
    	 * need to call it. It contains most of the game logic.
    	 */
    	@Override
    	public void paint(Graphics canvas) {
    		// display the current game board
    		displayGame(canvas);
     
    		// the following block will run every time the user clicks the mouse
    		if (mouseClicked) { // when the user clicks the mouse
    			// if the game is ready to start or to be restarted
    			if (restart) {
    				// clear the window and set up the game again
    				wipeBoard(canvas);
    				setUpGame();
    				repaint();
    			}
    			// else, if the game is in play, check if the click is on a legal
    			// square
    			else if (legalSquare(xMouseSquare, yMouseSquare)) {
    				// if the square is legal, mark the corresponding position as
    				// taken by HUMAN
    				setMovePosition(xMouseSquare, yMouseSquare, HUMAN);
    				// display the new position with a HUMAN_COLOR circle
    				displayHit(canvas, HUMAN_COLOR, xMouseSquare, yMouseSquare);
    				// check if the game ends (if it is, HUMAN wins)
    				if (gameEnd()) {
    					// if HUMAN wins, mark the winning line as a special color.
    					markWinningLine(canvas);
    					// display the human winning message
    					canvas.setFont(new Font("SansSerif", Font.PLAIN, 30));
    					canvas.setColor(GAME_OVER_MESSAGE_COLOR);
    					canvas.drawString(GAME_WIN_MESSAGE, squareWidth / 2,
    							squareWidth);
    					// mark the game as ready to restart
    					restart = true;
    				} else if (gameDraw()) {
    					// if HUMAN doesn't win but the board is full, it is a draw
    					// display the draw message
    					canvas.setFont(new Font("SansSerif", Font.PLAIN, 30));
    					canvas.setColor(GAME_OVER_MESSAGE_COLOR);
    					canvas.drawString(GAME_DRAW_MESSAGE, squareWidth / 2,
    							squareWidth);
    					// mark the game as ready to restart
    					restart = true;
    				} else {
    					// if HUMAN doesn't win and the board is not full, the CPU
    					// is ready to move
    					CPUinMove = true;
    					// calculates the next CPU move
    					CPUMove();
    					// mark the corresponding position as taken by CPU
    					setMovePosition(xCPUMove, yCPUMove, CPU);
    					// display the new position with a CPU_COLOR circle
    					displayHit(canvas, CPU_COLOR, xCPUMove, yCPUMove);
    					CPUinMove = false;
    					if (gameEnd()) {
    						// if CPU wins, mark the winning line as a special
    						// color.
    						markWinningLine(canvas);
    						// display the human losing message
    						canvas.setFont(new Font("SansSerif", Font.PLAIN, 30));
    						canvas.setColor(GAME_OVER_MESSAGE_COLOR);
    						canvas.drawString(GAME_LOSE_MESSAGE, squareWidth / 2,
    								squareWidth);
    						// mark the game as ready to restart
    						restart = true;
    					}
    					// else (if the game is not ended after the CPU move), the
    					// game is ready to get the next HUMAN move
    				}
    			}
    			mouseClicked = false;
    		}
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * This method initializes the applet. You will not need to call it.
    	 */
    	@Override
    	public void init() {
    		setSize(BOARD_SIZE_PIXELS, BOARD_SIZE_PIXELS);
    		setBackground(BACKGROUND_COLOR);
    		setUpGame();
    	}
     
    	/*
    	 * DO NOT change this method.
    	 * 
    	 * Creates a fresh game board and sets up the game state to get ready for a
    	 * new game.
    	 */
    	private void setUpGame() {
    		buildBoard();
    		CPUinMove = false;
    		restart = false;
    		onFirstMove = true;
    	}
     
    }


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: NEED HELP WRITING METHODS FOR TIC-TAC-TOE PROGRAM

    Do you have a question?

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: NEED HELP WRITING METHODS FOR TIC-TAC-TOE PROGRAM

    I am really horrible at Java coding
    The first stage of creating a program is making the design: a list of the steps the program needs to take to do the task. Once that list has been made, then chose a language for the implementation and start coding.
    Do you have a list of steps you are working on? Start with the first one, describe it and ask some questions about the problems you are having coding it.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Tic-Tac-Toe (loops, arrays, and methods) help please
    By CVL220 in forum Collections and Generics
    Replies: 3
    Last Post: November 10th, 2012, 01:47 PM
  2. Need help with a tic tac toe program
    By RodePope4546 in forum Java Theory & Questions
    Replies: 3
    Last Post: October 22nd, 2012, 05:47 PM
  3. Tic Tac Toe Program, Can someone help me out????
    By KVM in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 23rd, 2012, 04:47 PM
  4. [SOLVED] Tic-Tac-Toe program
    By Actinistia in forum Java Theory & Questions
    Replies: 2
    Last Post: April 28th, 2011, 11:18 PM

Tags for this Thread