Course Solutions Uncategorized (Solved) : Code Everyhting Fine Want Put Row Coumn Choice 1 2 3 0 1 2 Anyone Please Import Javautilsc Q31894021 . . . .

(Solved) : Code Everyhting Fine Want Put Row Coumn Choice 1 2 3 0 1 2 Anyone Please Import Javautilsc Q31894021 . . . .

 

In the below code: Everyhting is fine, I just want toput the row and coumn choice as 1 2 3 not 0 1 2. Can anyone do thatfor me please?

import java.util.Scanner;

public class TicTacToe {

    private char[][] board=newchar[3][3];

    //Game Board

    public void GameBoard(){

        for(inta=0;a<3;a++)

            for(intb=0;b<3;b++)

                board[a][b]=(”);

    }

    public char changePlayer(charplayer){

        charnewTurn=(‘O’);

        if(player ==(‘X’))

            newTurn=(‘O’);

        if(player ==(‘O’))

            newTurn=(‘X’);

        returnnewTurn;

    }

    //Method: Display the board.

    public void displayBoard(){

        System.out.println(“t|”+board[0][0]+”|”+board[0][1]+”|”+board[0][2]+”|”);

        System.out.println(“t_______”);

        System.out.println(“t|”+board[1][0]+”|”+board[1][1]+”|”+board[1][2]+”|”);

        System.out.println(“t_______”);

        System.out.println(“t|”+board[2][0]+”|”+board[2][1]+”|”+board[2][2]+”|”);

    }

    public void changeBoard(char player,intRow, int Column){

        board[Row][Column]=player;

    }

    //Checking the space availability in thematrix

    public boolean checkIfFull(int Row,intColumn){

        if((Row>2 ||Column>2)||(Row<0 || Column<0))

            returntrue;

        elseif(board[Row][Column]==’X’ || board[Row][Column]==’O’)

            returntrue;

        returnfalse;

    }

    public boolean checkWin(){

        if(board[0][0]==board[1][0]&& board[1][0]==board[2][0] &&(board[0][0]==(‘X’)|| board[0][0]==(‘O’)))

            returntrue;

        elseif(board[1][0]==board[0][1] && board[1][1]==board[2][1]&&(board[0][1]==(‘X’) || board[0][1]==(‘O’)))

            returntrue;

        elseif(board[0][2]==board[1][2] && board[1][1]==board[2][2]&&(board[0][2]==(‘X’) || board[0][2]==(‘O’)))

            returntrue;

        elseif(board[0][0]==board[0][1] && board[0][1]==board[0][2]&&(board[0][0]==(‘X’) || board[0][0]==(‘O’)))

            returntrue;

        elseif(board[1][0]==board[1][1] && board[1][1]==board[1][2]&&(board[1][0]==(‘X’) || board[1][0]==(‘O’)))

            returntrue;

        elseif(board[2][0]==board[2][1] && board[2][1]==board[2][2]&&(board[2][0]==(‘X’) || board[2][0]==(‘O’)))

            returntrue;

        elseif(board[0][0]==board[1][1] && board[1][1]==board[2][2]&&(board[0][0]==(‘X’) || board[0][0]==(‘O’)))

            returntrue;

        elseif(board[2][0]==board[1][1] && board[1][1]==board[0][2]&&(board[2][0]==(‘X’) || board[2][0]==(‘O’)))

            returntrue;

        else

            returnfalse;

    }

    public boolean

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Mysql Query Language Please Help Find Name Phloggers 4 Events Associated Attributes Q37992707 . . . .(Solved) : Mysql Query Language Please Help Find Name Phloggers 4 Events Associated Attributes Q37992707 . . . .

<p>MYSQL Query Language please help</p><p><strong>Find the name of PHLoggers who have more than 4 eventsassociated with them.</strong></p><p><strong>here are the attributes:<br/><img alt="tnum number observation_id PHLG obs observationid PHLogger address street address_state