Page 1 of 2 12 LastLast
Results 1 to 20 of 21
  1. #1
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Not sure how to fix this issue with a method...

    Okay so I have been working on this project for some time now. This is what I have so far, the issue to completing it is on lines 84-91. I need to figure out the code for CROSS, NOUGHT, and TIE. With the current code I have I get this in the output section...


    run:
    | | | |
    ------

    | | | |
    ------

    | | | |
    ------


    -0's turn-
    Enter row and Column


    But that is wrong, it is supposed to look like this in the output section...

    ||||
    -------
    ||||
    -------
    ||||
    -------
    --Os turn--
    |O| | |
    -------
    ||||
    -------
    ||||
    -------
    --Xs turn--
    |O|X| |
    ------- |||| ------- |||| -------

    --Os turn--
    |O|X| |
    -------
    | |O| |
    -------
    ||||
    -------
    --Xs turn--
    |O|X| |
    -------
    | |O| |
    -------
    |X| | |
    ______
    Os turn
    |O|X| |
    -------
    | |O| |
    -------
    |X| |O|
    O wins!



    Any help is appreciated.

    Here is my code..







    Java Code:
    package tictactoegame;
    
    /**
     *
     * @author 
     */
    public class tictactoegame {
        
        static int [] [] gameboard;
        static final int EMPTY = 0;
        static final int NOUGHT = -1;
        static final int CROSS = 1;
        
        static void set (int val, int row)
                throws IllegalArgumentException {
            int col = 0;
            if (gameboard[row] [col]  == EMPTY)
                    gameboard[row] [col] = val;
            else throw new
                IllegalArgumentException("Player already there!");
        }
        
        static void displayBoard () {
            for (int[] gameboard1 : gameboard) {
                System.out.print("|");
                for (int c = 0; c < gameboard1.length; c++) {
                    switch (gameboard1[c]) {
                        case NOUGHT:
                            System.out.print("0");
                            break;
                        case CROSS:
                            System.out.print("X");
                            break;
                        default:           //Empty
                            System.out.print(" ");
                    }
                    System.out.print("|");
                }
                System.out.println("\n------\n");
            }
        }
        static void createBoard(int rows, int cols) {
            gameboard = new int [rows] [cols];
        }
        
        static int winOrTie() {
        if (gameboard[0][0] + gameboard[0][1] + gameboard[0][2] == 3*NOUGHT) 
        {return NOUGHT;}
        if (gameboard[1][0] + gameboard[1][1] + gameboard[1][2] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[2][0] + gameboard[2][1] + gameboard[2][2] == 3*NOUGHT)
        {return NOUGHT;}
     
        if (gameboard[0][0] + gameboard[1][0] + gameboard[2][0] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][1] + gameboard[1][1] + gameboard[2][1] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][2] + gameboard[1][2] + gameboard[2][2] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][0] + gameboard[1][1] + gameboard[2][2] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][2] + gameboard[1][1] + gameboard[2][0] == 3*NOUGHT)
        {return NOUGHT;}
    
        if (gameboard[0][0] + gameboard[0][1] + gameboard[0][2] == 3*CROSS)
        {return CROSS;}    
        if (gameboard[1][0] + gameboard[1][1] + gameboard[1][2] == 3*CROSS)
        {return CROSS;}
        if (gameboard[2][0] + gameboard[2][1] + gameboard[2][2] == 3*CROSS)
        {return CROSS;}
    
        if (gameboard[0][0] + gameboard[1][0] + gameboard[2][0] == 3*CROSS)
        {return CROSS;}    
        if (gameboard[0][1] + gameboard[1][1] + gameboard[2][1] == 3*CROSS)
        {return CROSS;}
        if (gameboard[0][2] + gameboard[1][2] + gameboard[2][2] == 3*CROSS)
        {return CROSS;}
        
        if (gameboard[0][0] + gameboard[1][1] + gameboard[2][2] == 3*CROSS)
        {return CROSS;} 
        if (gameboard[0][2] + gameboard[1][1] + gameboard[2][0] == 3*CROSS)
        {return CROSS;}
    
        if (CROSS has won){
            return
         else if (NOUGHT has won)
            return
         else if (The game ends in a Tie)           
            return
         else
            return -2;
        }
        
        
              
         
         public static void main(String[] args)  {
            createBoard(3,3);
            int turn = 0;
            int playerVal;
            int outcome;
            java.util.Scanner scan = new
                java.util.Scanner(System.in);
            do {
                displayBoard();
                playerVal = (turn % 2 == 0)? NOUGHT : CROSS;
                if (playerVal == NOUGHT) {
                    System.out.println ("\n-0's turn-");
                } else {
                    System.out.println("\n-X's turn-");
                    }
                System.out.print("Enter row and Column:");
                try {
                    set(playerVal, scan.nextInt());
                } catch (IllegalArgumentException ex)
                {System.err.println(ex);}
                turn ++;
                outcome = winOrTie();
            } while ( outcome == -2 );
            displayBoard();
            switch (outcome) {
                case NOUGHT:
                    System.out.println("0 wins!");
                    break;
                case CROSS:
                    System.out.println("X wins!");
                    break;
                case 0:
                    System.out.println("Tie.");
                    break;
                }
         }
         
    }

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,954
    Rep Power
    7

    Default Re: Not sure how to fix this issue with a method...

    You've already written the code for who wins in the method winOrTie(). You could move that code to a method, using the NOUGHT/CROSS as parameter, and call that as
    Java Code:
    boolean hasCrossWon = hasWon(CROSS);
    boolean hasNoughtWon = hasWon(NOUGHT);
    boolean tie = !hasCrossWon && !hasNoughtWon;
    Java Code:
    public static boolean hasWon(int type) {
    return gameboard[0][0] + gameboard[0][1] + gameboard[0][2] == 3 * type ||
             gameboard[1][0] + gameboard[1][1] + gameboard[1][2] == 3 * type ||
             .... etc
    }
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    So instead of having the if statements in lines 84-91 replace it with something like you have posted?

    Thanks for your help

  4. #4
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,954
    Rep Power
    7

    Default Re: Not sure how to fix this issue with a method...

    Your method is close to completion. I see you don't need my example.

    In your winOrTie method you return values early, like return NOUGHT; after the first check. That is fine. So now you have checked all the possibilities. At the end of the method you still need to return a value for when nobody wins (tie) or return -2 for when the game is still going, so it will look something like this:

    (I used a non-existing method for you to create: isBoardFull() that checks if all the values in the board are not EMPTY.)
    Java Code:
    static int winOrTie() {
        if (gameboard[0][0] + gameboard[0][1] + gameboard[0][2] == 3 * NOUGHT) {
            return NOUGHT;
        }
        if (gameboard[1][0] + gameboard[1][1] + gameboard[1][2] == 3 * NOUGHT) {
            return NOUGHT;
        }
        if (gameboard[2][0] + gameboard[2][1] + gameboard[2][2] == 3 * NOUGHT) {
            return NOUGHT;
        }
        .... all the other checks
    
        if ( ! isBoardFull() ) {
            return -2;
        }
        else {
            return 0; //0 is tie?
        } 
    }
    Also, make it a habit to always use curly braces around ifs. It is confusing and error prone if you don't. Check this example:
    Java Code:
    public static void main(String[] args) {
       if( false ) 
          System.out.println("Hello");
          System.out.println("World");
    }
    What does this print? World.
    Last edited by SurfMan; 05-04-2017 at 10:58 AM.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  5. #5
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    Thank you for your help. I will work on it tonight. Thank you again.

  6. #6
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    I have worked on the project some more. When I click to run the project it continuously runs unless I click the stop button. Also in the output section I am still getting what I posted above.

  7. #7
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,954
    Rep Power
    7

    Default Re: Not sure how to fix this issue with a method...

    If it runs continuously, I'm guessing (cos that's all I can without the source code) that your winOrTie method never returns -2. Use your IDE to put a breakpoint at the start of the winOrTie method and step through each line. That way you can see what the board looks like and what the return value should be.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  8. #8
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    I have replied twice in this thread but the response isn't showing up. I am getting a unsupported operation exception. It is because the isBoardFull method isn't supported. Where exactly should that be inserted?



    Java Code:
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package tictactoegame;
    
    /**
     *
     * @author Doug Henderson
     */
    public class tictactoegame {
        
        static int [] [] gameboard;
        static final int EMPTY = 0;
        static final int NOUGHT = -1;
        static final int CROSS = 1;
        
        static void set (int val, int row)
                throws IllegalArgumentException {
            int col = 0;
            if (gameboard[row] [col]  == EMPTY)
                    gameboard[row] [col] = val;
            else throw new
                IllegalArgumentException("Player already there!");
        }
        
        static void displayBoard () {
            for (int[] gameboard1 : gameboard) {
                System.out.print("|");
                for (int c = 0; c < gameboard1.length; c++) {
                    switch (gameboard1[c]) {
                        case NOUGHT:
                            System.out.print("0");
                            break;
                        case CROSS:
                            System.out.print("X");
                            break;
                        default:           //Empty
                            System.out.print(" ");
                    }
                    System.out.print("|");
                }
                System.out.println("\n------\n");
            }
        }
        static void createBoard(int rows, int cols) {
            gameboard = new int [rows] [cols];
        }
        
        static int winOrTie() {
        if (gameboard[0][0] + gameboard[0][1] + gameboard[0][2] == 3*NOUGHT) 
        {return NOUGHT;}
        if (gameboard[1][0] + gameboard[1][1] + gameboard[1][2] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[2][0] + gameboard[2][1] + gameboard[2][2] == 3*NOUGHT)
        {return NOUGHT;}
     
        if (gameboard[0][0] + gameboard[1][0] + gameboard[2][0] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][1] + gameboard[1][1] + gameboard[2][1] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][2] + gameboard[1][2] + gameboard[2][2] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][0] + gameboard[1][1] + gameboard[2][2] == 3*NOUGHT)
        {return NOUGHT;}
        if (gameboard[0][2] + gameboard[1][1] + gameboard[2][0] == 3*NOUGHT)
        {return NOUGHT;}
    
        if (gameboard[0][0] + gameboard[0][1] + gameboard[0][2] == 3*CROSS)
        {return CROSS;}    
        if (gameboard[1][0] + gameboard[1][1] + gameboard[1][2] == 3*CROSS)
        {return CROSS;}
        if (gameboard[2][0] + gameboard[2][1] + gameboard[2][2] == 3*CROSS)
        {return CROSS;}
    
        if (gameboard[0][0] + gameboard[1][0] + gameboard[2][0] == 3*CROSS)
        {return CROSS;}    
        if (gameboard[0][1] + gameboard[1][1] + gameboard[2][1] == 3*CROSS)
        {return CROSS;}
        if (gameboard[0][2] + gameboard[1][2] + gameboard[2][2] == 3*CROSS)
        {return CROSS;}
        
        if (gameboard[0][0] + gameboard[1][1] + gameboard[2][2] == 3*CROSS)
        {return CROSS;} 
        if (gameboard[0][2] + gameboard[1][1] + gameboard[2][0] == 3*CROSS)
        {return CROSS;}
       
    
        if ( !isBoardFull () ){
            return -2;
        }
        else {
            return 0; //0 is tie?
           }
        }
              
         
         public static void main(String[] args)  {
            createBoard(3,3);
            int turn = 0;
            int playerVal;
            int outcome;
            java.util.Scanner scan = new
                java.util.Scanner(System.in);
            do {
                displayBoard();
                playerVal = (turn % 2 == 0)? NOUGHT : CROSS;
                if (playerVal == NOUGHT) {
                    System.out.println ("\n-0's turn-");
                } else {
                    System.out.println("\n-X's turn-");
                    }
                System.out.print("Enter row and Column:");
                try {
                    set(playerVal, scan.nextInt());
                } catch (IllegalArgumentException ex)
                {System.err.println(ex);}
                turn ++;
                outcome = winOrTie();
            } while ( outcome == -2 );
            displayBoard();
            switch (outcome) {
                case NOUGHT:
                    System.out.println("0 wins!");
                    break;
                case CROSS:
                    System.out.println("X wins!");
                    break;
                case 0:
                    System.out.println("Tie.");
                    break;
                }
         }
    
        private static boolean isBoardFull() {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
    
        
        }

  9. #9
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,954
    Rep Power
    7

    Default Re: Not sure how to fix this issue with a method...

    You are getting that exception, because it is programmed to do so. What do you think "throw new UnsupportedOperationException()" does?

    I assume you need to implement that method. So think about it. When is the board full? Obviously when the gameboard array is no empty places. Write on paper how you would do that by hand. How would you check nine boxes to see if they have something in it? I'd say you count the number of EMPTY locations on the gameboard. If that count is 0, then there are no more empty spots.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  10. #10
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,421
    Blog Entries
    7
    Rep Power
    26

    Default Re: Not sure how to fix this issue with a method...

    Mweh, I would simply return false as soon as I've found an emtyp slot. If none could be found (the board is full) I'd return true ...

    Kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  11. #11
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    Second time I am posting this, hopefully this response will be allowed. I have revamped my code but am still having the same issues. When I click the run project button it continuously runs unless I stop it. Also I still only get the following in the output section.. Note: When I attempt to use the debugger it never stops either. I set a breakpoint and it continues never stopping. I am beyond annoyed with this project.


    run:
    | | | |
    ------

    | | | |
    ------

    | | | |
    ------


    -0's turn-
    Enter row and Column:



    Java Code:
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    package tictactoegame;
    
    /**
     *
     * @author doughenderson
     */
    public class tictactoegame {
        
        static int [] [] gameboard;
        static final int EMPTY = 0;
        static final int NOUGHT = -1;
        static final int CROSS = 1;
        
        static void set (int val, int row, int col)
                throws IllegalArgumentException {
            if (gameboard[row] [col]  == EMPTY) {
                    gameboard[row] [col] = val;
            } else throw new
                IllegalArgumentException("Player already there!");
        }
    
        static void displayBoard () {
            for (int[] gameboard1 : gameboard) {
                System.out.print("|");
                for (int c = 0; c < gameboard1.length; c++) {
                    switch (gameboard1[c]) {
                        case NOUGHT:
                            System.out.print("0");
                            break;
                        case CROSS:
                            System.out.print("X");
                            break;
                        default:           //Empty
                            System.out.print(" ");
                    }
                    System.out.print("|");
                }
                System.out.println("\n------\n");
            }
        }
        static void createBoard(int rows, int cols) {
            gameboard = new int [rows] [cols];
        }
        
        static int winOrTie() {
        if (gameboard[0][0] == 1 && gameboard[0][1] == 1 && gameboard[0][2] == 1) 
        {return 1;
        } else if (gameboard[0][0] == -1 && gameboard[0][1] == -1 && gameboard[0][2] == -1)
        {return -1;
        } else if (gameboard[0][0] == 1 && gameboard[1][0] == 1 && gameboard[2][0] == 1)
        {return 1;
        } else if (gameboard[0][0] == -1 && gameboard[1][0] == -1 && gameboard[2][0]== -1)
        {return -1;
        } else if (gameboard[1][0] == 1 && gameboard[1][1] == 1 && gameboard[1][2] == 1)
        {return 1;
        } else if (gameboard[1][0] == -1 && gameboard[1][1] == -1 && gameboard[1][2] == -1)
        {return 1;
        } else if (gameboard[2][0] == 1 && gameboard[2][1] == 1 && gameboard[2][2] == -1)
        {return 1;
        } else if (gameboard[2][0] == -1 && gameboard[2][1] == -1 && gameboard[2][2] == -1)
        {return 1;
        } else if (gameboard[0][2] == 1 && gameboard[1][2] == 1 && gameboard[2][2] == 1)
        {return 1;
        } else if (gameboard[0][2] == -1 && gameboard[1][2] == -1 && gameboard[2][2] == -1)
        {return -1;
        } else if (gameboard[0][1] == 1 && gameboard[1][1] == 1 && gameboard[2][1] == 1)
        {return 1;
        } else if (gameboard[0][1] == -1 && gameboard[1][1] == -1 && gameboard[2][1] == -1)
        {return -1;
        } else if (gameboard[0][0] == 1 && gameboard[1][1] == 1 && gameboard[2][2] == 1)
        {return 1;
        } else if (gameboard[0][0] == -1 && gameboard[1][1] == -1 && gameboard[2][2] == -1)
        {return -1;
        } else if (gameboard[0][2] == 1 && gameboard[1][1] == 1 && gameboard[2][0] == 1)
        {return 1;
        } else if (gameboard[0][2] == -1 && gameboard[1][1] == -1 && gameboard[2][0] == -1)
        {return -1;
        }
       
    //check if gameboard is empty or not
       int chk = 0;
       for (int i = 0; i <= 2; i++) {
           for (int j = 0; j <= 2; j++) {
               if (gameboard[i][j] == 0) {
                   chk = 1;
               }
           }
       }
       //if it is empty
       if (chk == 1) {
           return -2;
       } else { //gameboard is full returns tie
           return 0;
       }    
       }       
         
         public static void main(String[] args)  {
            createBoard(3,3);
            int turn = 0;
            int playerVal;
            int outcome;
            java.util.Scanner scan = new
                java.util.Scanner(System.in);
            do {
                displayBoard();
                playerVal = (turn % 2 == 0)? NOUGHT : CROSS;
                if (playerVal == NOUGHT) {
                    System.out.println ("\n-0's turn-");
                } else {
                    System.out.println("\n-X's turn-");
                    }
                System.out.print("Enter row and Column:");
                try {
                    int row = scan.nextInt();
                    int col = scan.nextInt();
                    set(playerVal, row, col);
                } catch (IllegalArgumentException ex)
                {System.err.println(ex);}
                turn ++;
                outcome = winOrTie();
            } while ( outcome == -2 );
            displayBoard();
            switch (outcome) {
                case NOUGHT:
                    System.out.println("0 wins!");
                    break;
                case CROSS:
                    System.out.println("X wins!");
                    break;
                case 0:
                    System.out.println("Tie.");
                    break;
                }
         }
    }

  12. #12
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,954
    Rep Power
    7

    Default Re: Not sure how to fix this issue with a method...

    It works for me:
    Java Code:
    -0's turn-
    Enter row and Column:2
    1
    |0|X|0|
    ------
    
    |0|X|X|
    ------
    
    |X|0|0|
    ------
    
    Tie.
    
    Process finished with exit code 0
    When does it never stop? Did you test this in your IDE or on the command line?
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  13. #13
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    I am testing this in the IDE. Also a new wrinkle has occurred, I am getting the following error..

    Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>

    This bit of code is the issue.

    Java Code:
    java.util.Scanner scan = new java.util.Scanner(System.in); 
         do {
    Last edited by Sabre; 06-19-2017 at 06:29 AM.

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    25

    Default Re: Not sure how to fix this issue with a method...

    Well, that implies you are trying to run code that doesn't currently compile.
    The IDE will attempt to compile the code and then fall over.

    So, presumably the IDE has marked one or more of your files as having an error?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  15. #15
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    387
    Rep Power
    4

    Default Re: Not sure how to fix this issue with a method...

    Are you working with Netbeans?

  16. #16
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    Yes Netbeans

  17. #17
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    25

    Default Re: Not sure how to fix this issue with a method...

    Have you sorted out the compiler issue?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  18. #18
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    387
    Rep Power
    4

    Default Re: Not sure how to fix this issue with a method...

    Quote Originally Posted by Sabre View Post
    Yes Netbeans
    Chances are it is a Netbeans specific problem. Here is an explanation and some workarounds. Use the third answer.

  19. #19
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    I unchecked the compile on save and it changed coming back as a successful build with the following...

    Java Code:
    ant -f /Users/zacharyhall/Documents/TicTacToeGame -Dnb.internal.action.name=clean clean
    init:
    deps-clean:
    Updating property file: /Users/doughenderson/Documents/TicTacToeGame/build/built-clean.properties
    Deleting directory /Users/doughenderson/Documents/TicTacToeGame/build
    clean:
    BUILD SUCCESSFUL (total time: 0 seconds)
    Last edited by Sabre; 06-24-2017 at 06:34 PM.

  20. #20
    Sabre is offline Member
    Join Date
    Jan 2017
    Posts
    13
    Rep Power
    0

    Default Re: Not sure how to fix this issue with a method...

    YET...when I then click the run project button the following shows up...

    Java Code:
    ant -f /Users/doughenderson/Documents/TicTacToeGame -Dnb.internal.action.name=run run
    init:
    deps-jar:
    Created dir: /Users/doughenderson/Documents/TicTacToeGame/build
    Updating property file: /Users/doughenderson/Documents/TicTacToeGame/build/built-jar.properties
    Created dir: /Users/doughenderson/Documents/TicTacToeGame/build/classes
    Created dir: /Users/doughenderson/Documents/TicTacToeGame/build/empty
    Created dir: /Users/doughenderson/Documents/TicTacToeGame/build/generated-sources/ap-source-output
    Compiling 1 source file to /Users/doughenderson/Documents/TicTacToeGame/build/classes
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:123: error: illegal start of expression
     public static void main(String[] args) {
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:123: error: illegal start of expression
     public static void main(String[] args) {
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:123: error: ';' expected
     public static void main(String[] args) {
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:123: error: '.class' expected
     public static void main(String[] args) {
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:123: error: ';' expected
     public static void main(String[] args) {
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:139: error: ';' expected
                 set(playerVal, row, col):
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:157: error: reached end of file while parsing
         }
    /Users/doughenderson/Documents/TicTacToeGame/src/tictactoegame/TicTacToeGame.java:158: error: reached end of file while parsing
    8 errors
    /Users/doughenderson/Documents/TicTacToeGame/nbproject/build-impl.xml:930: The following error occurred while executing this line:
    /Users/doughenderson/Documents/TicTacToeGame/nbproject/build-impl.xml:270: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 1 second)

Page 1 of 2 12 LastLast

Similar Threads

  1. Fraction Class equals method issue
    By RachLee in forum New To Java
    Replies: 16
    Last Post: 09-23-2015, 06:23 AM
  2. Regular Expression issue and setName() method issue
    By geforce in forum New To Java
    Replies: 2
    Last Post: 01-30-2012, 03:33 AM
  3. logical accept() method issue
    By senca in forum Networking
    Replies: 6
    Last Post: 11-01-2011, 09:34 PM
  4. Bubblesort Issue within Method
    By burrish in forum New To Java
    Replies: 9
    Last Post: 09-27-2011, 02:39 AM
  5. Issue in method anonymous class in GWT
    By ankit01 in forum GWT
    Replies: 0
    Last Post: 05-16-2011, 11:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •