Violet_82 89 Posting Whiz in Training

ok, not really familiar with "packages" (I presume you mean API?), is it something that you need to consider when using an IDE? I don't use any as yet and if I use more classes (I think I have done it only once) I have them in the same folder together with the test file

Violet_82 89 Posting Whiz in Training

Ok thanks, I think it is clear. Will see when I will use it : - )!
thanks for the explanations!

Violet_82 89 Posting Whiz in Training

ah ok I see, I think something like that is actually more versatile than the original heavy case, I might get that too then. Well thanks a lot for all your help, I have bought the docking station, so I will try it as soon as it arrives!
thanks again

Violet_82 89 Posting Whiz in Training

Hi I would be really interested to understand how exactly the toString() method works. I have read quite a bit about it, that it returns the string representation of
an object, that the default one can be overridden with @Override etc etc.
Let's have a look at some examples:

   @Override // indicates that this method overrides a superclass method
   public String toString()
   {
      return String.format( "%s: %s %s\n%s: %s\n%s: %.2f\n%s: %.2f", 
         "commission employee", firstName, lastName, 
         "social security number", socialSecurityNumber, 
         "gross sales", grossSales, 
         "commission rate", commissionRate );
   } // end method toString

and it is called in this way

System.out.printf( "\n%s:\n\n%s\n", 
         "Updated employee information obtained by toString", 
         employee.toString() );

where employee is an object. firstName, lastName etc are all private instance variables of the class

Or anothe similar one:

@Override // indicates that this method overrides a superclass method
   public String toString()
   {
      return String.format( "%s: %s %s\n%s: %s\n%s: %.2f\n%s: %.2f", 
         "commission employee", firstName, lastName, 
         "social security number", socialSecurityNumber, 
         "gross sales", grossSales, 
         "commission rate", commissionRate );
   } // end method toString

which is called by

 System.out.printf( "\n%s:\n\n%s\n", 
         "Updated employee information obtained by toString", employee );

again, employee is the object.

Now what I don't understand is what is the difference between printing an object this way and printing an object with a normal call to System.out.printf and list the instance
variables? I mean why do I need a toString method for? Maybe in the examples above, since they …

Violet_82 89 Posting Whiz in Training

thanks, so as long as they are in the same folder they are ok.

Violet_82 89 Posting Whiz in Training

I think you're right about the soldering iron thing. I mean I had a look they are actually cheaper than the docking station, but having had a look at the connector more carefully, I can see that most of the metallic pins are missing, so I think you have a point in saying that the connection won't be as stable as ut shoukd be. I think if I solder it I will end up buying the docking station anyway so I might as well buy it now without any fluffing aroung. I like the cable option but i am abit worry that wi Ill have too many cables flying around, and then I will have to look for a box that fit the HD and that has big enough holes to fit the cable plugs etc. No, a docking station will be!
One thing I would like to pick up on, the static you mentioned. Well, if I go for the docking station, when I have finished using the HD, can I leave it inserted in the docking station all the time even if it is okk or if I use it for something else? If not I can disconnect the HD and put it back in his current metal box, where it has always been.

Violet_82 89 Posting Whiz in Training

Thanks @AHarrisGsy this is really interesting actually, didn't know such a thing existed, but after having had a look, I think the docking station is the best option as opposed to have too many cables running all over the place. I was just thinking though, if it is worth first of all to buy a soldering iron and try to solder the connector back to the pins? Is it doable? I mean the pins are broken but the the melted metal should do the work don't you think? If that fails then the docking station

@mat1998x, no unfortunately I don't have a desktop machine, but another spare laptop...I wonder whether I can use that.

The thing is thought, if I can of course, I am looking for a more permanent solution, because I wouldn't want to buy another external drive, so I will have to look into either the soldering iron or the docking station, or both.

Violet_82 89 Posting Whiz in Training

Hi all, I am reading a bit about inheritance, super classes and subclasses. Now when I build a java program I usually have a java file for the class and another one to test the class. I was wondering if I use a superclass and a subclass, should they be in the same file or in 2 different files?
thanks

Violet_82 89 Posting Whiz in Training

uhm...I see, so by docking station you mean something like this:http://www.ebay.co.uk/itm/2-5-3-5-SATA-IDE-HDD-2-Dock-Docking-Station-e-SATA-Hub-New-/171021539000?pt=UK_Collectables_HardDriveEnclosures_RL&hash=item27d1ad96b8 (problem is I have to find something compatible with linux!)
I was thinking would a double usb suffice in terms of power then, something like this, similar to your cable http://www.amazon.co.uk/DeLOCK-61883-Converter-Adaptor-22-Pin/dp/B005OMXBN2/ref=pd_bxgy_computers_img_y

Violet_82 89 Posting Whiz in Training

Ah good news then. So I will buy the cable in your link. Just one thing: that cable seems to cover both the power and the data: I don't mean to be daft but there are 3 plugs in that cable: the sata, the usb and another one, does that go anywhere? Also, the HD is 1TB: now those apparently need a power source (as you can see I am not such an expert on the subject) so will just the sata cable be enough to power the the HD?
thanks

Violet_82 89 Posting Whiz in Training

82e0e47d598d3362d4aa0e38686a0d52

There! those you see on the left were inserted in the circuit board. One is for the power cable (which I believe still works but I will try it) and the other one is for the usb. Is that a SATA connector? I mean I am not an expert but those don't look like pins to me, it's just a solid bloc of plastic with some metal strips

Violet_82 89 Posting Whiz in Training

ok, I tell you what, let me remove the whole HD and I will take another picture and then we'll see what to do

Violet_82 89 Posting Whiz in Training

Well the actual HD is connected to the circuit board, here's a pic. If that qualifies as a SATA connector then yes. In the picture you can see the pins. What do you think? 838a9bf566049c42c194102a8355a5d3

Ah, I can disassemble it if it helps you guys to determine what sort of adapter I need

Violet_82 89 Posting Whiz in Training

well It is damaged in the sense that came off...
Now, the data on that HD is pretty important, I mean I am sure there is a way to recover it, even if I have to buy an adapter of some sort. Or maybe, how about buying a new circuit board? That will have the usb connector in there! 7017d16e650cab38a25a1da60a739215

Violet_82 89 Posting Whiz in Training

Hi,
I am afraid somebody somehow broke the usb connector of my Lacie 1TB hard drive (Starck), so I can't connect it ot the laptop anymore. I have removed it from the case and noticed that the plug is actually gone completely and the filaments that used to connect it to the circuit board are broken. Now, I don't have a soldering iron or anything like that, I would just like to be able to access my data in the HD, what should I do?
This is the HD I have http://www.amazon.co.uk/LaCie-Starck-Desktop-Hard-Drive/dp/B002SGATQE

Violet_82 89 Posting Whiz in Training

ok thanks, I will try next time and post again if fails

Violet_82 89 Posting Whiz in Training

Done that already mat1998x

Violet_82 89 Posting Whiz in Training

evidently not : - ), will give it a go next time, thanks!

Violet_82 89 Posting Whiz in Training

zipping them is an idea, but I use linux so I don't think I will be able to produce a zip file

Violet_82 89 Posting Whiz in Training

well I am not sure anymore what driver I have to be honest, I have tampered so much with that...Let's start from the beginning, how do I find out wha driver I have, is there a command for that?

Violet_82 89 Posting Whiz in Training

I tried already to boot up with the cable connected to it, and it didn't work, how fo I go to the invidia settings and how do I set the system to use the monitor?
thanks

Violet_82 89 Posting Whiz in Training

ah cool, yes that list is good. What I meant is that the list appeared in the attachment area where you upload files, and it's not there anymore. ANyway, in my case it didn't accept the java files, it said something like there was a problem or something along those lines. If there is a testing area I could try to replicate the error

Violet_82 89 Posting Whiz in Training

ah great idea passing the string, didn't occur to me at all!
Cool right, thanks for all your help, I will close the thread now.

Violet_82 89 Posting Whiz in Training

Hi thanks, yes I was aware of that rule (the import rule lets you write 'the short form'). In my case though, I didn't realize that the import rule import java.util.Scanner; had to be in 2 places, I have always thought that the file where I declare the new variable of type Scanner was the only one that had to have the declaration, even if the Scanner variable was used somewhere else, because the new objects is created once, if that makes sense. So, as an example, in my case because this Scanner input = new Scanner( System.in ); is in my TicTacToeTest.java I thought that's where the import declaration had to be, even if the input variable is used in a different file the new object has been created once. Does it make sense?

Violet_82 89 Posting Whiz in Training

Hi all, I am having serious troubles connecting my laptop to the tv. I can do that with windows ok, but not in the linux. Somebody suggested to install bumblebee http://eternalvoid.net/tutorials/linux-optimus-gt650m/, which I seem to have successfully done. I think the reason was because my laptop had the nvidia drives and they were causing troubles etc etc. Still I get a no signal message on the tv. I have tried the fn keys as I would in windows but nothing. I have tried under monitor no joy either. Is there any command I have to issue to get tv to pick up my laptop or something else? Is there anything else I should check on my laptop, like right drives being loaded or whatever?

Violet_82 89 Posting Whiz in Training

Chaps, I have tried to upload some java files on the forum (it's an exercise I was working on and after having done I tohught I would make the code available for everybody to use, in case anybody wants it), but there doesn't seem to be anyway to upload them, how is that? I remember some time ago you had a list of file types that could be uploaded on the site, I can't see that anymore, why has it been removed? It was so helpful. Where do I find the list of file extensions allowed please?
thanks

Violet_82 89 Posting Whiz in Training

Ok hang on, apparently the inport declaration needs to be in 2 places, both files. My bad. I thought the import declaration should have been used only where the Scanner variable is declared which is in my case TicTacToeTest.java. Clearly not. It works now, thanks guys for all your invaluable help as usual.
Here are the two files if anybody ever needs to use them and play around with them or whatever:

/*TicTacToe.java*/
import java.util.Scanner;
public class TicTacToe{ 
    //private boolean isFull = false;//if true all the squares have been assigned.
    //private int playerCounter = 1;//if it is odd it's player1's turn if even it's player2's turn
    private TicTacToeEn[][] board = new TicTacToeEn[3][3];//to represent the 3-by-3 board

    //private boolean isDraw;//to check if the game is draw
    //private boolean squareStatus;//returns the status of a square, if false the square is full if true the square is empty
    //private boolean victory;//if returns true one of the players has won  
    //private int row;//row of the 3-by-3 board
    //private int column;//column of the 3-by-3 board   
    //private int gameCounter;//counts the moves


    public enum TicTacToeEn{
        X, O, EMPTY 
    }//end of enum
    TicTacToeEn theSymbol;//of type enum holds the current theSymbol, X or O 
    //constructor
    public TicTacToe(){
        for( int i = 0; i < board.length; i++ ){
            for( int j = 0; j < board[i].length; j++ ){
                board[i][j] = TicTacToeEn.EMPTY;
            }//columns
        }//rows         
    }//end of constructor

    //checks if square is empty
    public boolean checkSquare( int row, int column ){
        if(board[row][column] == TicTacToeEn.EMPTY){
            return false;
        }
        else{
            return true; …
Violet_82 89 Posting Whiz in Training

ah ok, well good to know I can pass a variable of type scanner. I added the link to the online compiler thinking it might be easier, sorry maybe I was wrond. ANyway, let's see what I have done in more details then. The scanner import declaration is in my TicTacToeTest.java, together with the call to the validating method, see below excerpt:

/*TicTacToeTest.java*/
import java.util.Scanner;

public class TicTacToeTest{

    public static void main( String[] args ){
    boolean isFull = false;//if true all the squares have been assigned.
    boolean isDraw = false;//to check if the game is draw
    boolean squareIsFull = false;//returns the status of a square, if false the square is full if true the square is empty
    boolean victory = false;//if returns true one of the players has won
    int playerCounter = 1;//if it is odd it's player1's turn if even it's player2's turn
    int rowInput;
    int colInput;
        Scanner input = new Scanner( System.in );
        TicTacToe myTicTacToe = new TicTacToe();//create object
        myTicTacToe.printBoard();
        while( !isFull ){
            isDraw = myTicTacToe.isDraw();
            if( isDraw ){
                System.out.println( "The game is draw!\n" );
                //print board
                //myTicTacToe.printBoard();
                break;
            }
            //print board
            //myTicTacToe.printBoard();
            //System.out.println("the number is " + playerCounter );
            if( !(myTicTacToe.isOdd( playerCounter ))){//player 1
                System.out.println( "\nPlayer 1: enter the coordinates of the square.\nRow and column - values between 1 and 3." );
            }
            else{//player 2
                System.out.println( "\nPlayer 2: enter the coordinates of the square.\nRow and column - values between 1 and 3." );
            }

            rowInput = myTicTacToe.getRowNumber( input ); // getRowNumber will always return a valid …
Violet_82 89 Posting Whiz in Training

Right, done some validation, yay. The thing is it doesn't work. I compiled the program and the first time I got 6 errors, realizing that I did something silly. SO now I get only 2 errors. Let's have a look at the code.
in my TicTacToeTest.java I have this:

            rowInput = myTicTacToe.getRowNumber( input ); // getRowNumber will always return a valid row number
            rowInput = myTicTacToe.getRowNumber( input ); // getRowNumber will always return a valid row number

and in the TicTacToe.java I have the 2 methods (sorry I tried to use only one method, it makes more sense doesn't it? but it was a bit difficult to find a way to say to the method, if it's a row then print 'Row and press enter or type exit to leave the program' and if it's a column print 'Col and press enter or type exit to leave the program'). Sorry been a long day today!

//validation row
    public int getRowNumber( Scanner scanner ){
        int rowNumber;
        System.out.println( "\nRow and press enter or type exit to leave the program: " );
        while( true ){
            String userInput = scanner.next();
            if ("exit".equalsIgnoreCase( userInput )){
                System.exit(1);//if users types exit, program terminates
            }

            try{
                rowNumber = Integer.valueOf( userInput ); // goes straight to catch if input not numeric
                if (( rowNumber >= 1 ) && ( rowNumber <= 3 )){
                    return rowNumber; // input was valid
                }
            }                
            catch( Exception e ){
                System.out.println( "\nRe-enter row number, must be an integer value, …
Violet_82 89 Posting Whiz in Training

I actually haven't compiled it no sorry, I thought I'd get your opinion on the logic first. When I coded the validation, my assumption was that in here while( !(myTicTacToe.isInteger( rowInput )) || (( rowInput < 1 ) || ( rowInput > 3 )){ when I called the method with a string parameter, the string would be converted into a int ( inside isInteger() with this try{ Integer.parseInt(s); } ) therefore it would have been safe enough for me to say something like rowInput < 1. I take my assumption was wrong?

Violet_82 89 Posting Whiz in Training

hi all sorry for the delay in posting back. Thanks for the suggestions. I have tried to gather them all together and come up with something. Here it is.
Basically I have added a function in my TicTacToe.java file:

//validation 
    public static boolean isInteger(String s){
        try{ 
            Integer.parseInt(s); 
        } 
        catch(NumberFormatException e){ 
            return false; 
        }
        return true;
    }//end of validation

And in the TicTacToeTest.java instead I changed the code slightly:
1) the two integer values rowInput and colInput are no of type String
2)I have changed input.nextInt() to input.next() (I have read somewhere that this method allows the user to input just one word - in my case a string '1', '2' or '3' - and discard the white space)
3)validated the two inputs separately. Here's the code:

    ...
    String rowInput;
    String colInput;
    ...

    System.out.println( "\nRow and press enter: " );
    rowInput = input.next();
    //validation row
    while( !(myTicTacToe.isInteger( rowInput )) || (( rowInput < 1 ) || ( rowInput > 3 )){
        System.out.println("\n The input has to be a number between 1 and 3, try again");
        rowInput = input.next();
    }
    //end of validation row     

    System.out.println( "\nColumn and press enter: " );
    colInput = input.next();
    //validation column
    while( !(myTicTacToe.isInteger( colInput )) || (( colInput < 1 ) || ( colInput > 3 )){
        System.out.println("\n The input has to be a number between 1 and 3, try again");
        colInput = input.next();
    }

If you want to see two files here they are:

Violet_82 89 Posting Whiz in Training

thanks, I this this is one of the things I don't understand about validating data, the fact that I have to have it inserted in a different format (a string) to validate it as an input. By all means, if this is the way to go then so be it. But I am kind of wondering then, if I go with this solution, then I have to make sure the string is actually converted to an integer before I make use of it (in the program in questions the inputs - row and column - are passed as integers to the methods)

Violet_82 89 Posting Whiz in Training

thanks guys.

you are reading int input and are treating it as booleans. that's not how it works.

What do you mean by that? input is a Scanner type and I would have thought any variable could be tested with hasNextInt() because that function returns true or false.

Start with one simple validation, get it working, then repeat that pattern.

I am following your structure, but I wonder, is there a method (I couldn't find one and I had a look on the net quite a bit now trying to understand how validating an int is achieved) that returns true if an input is a int and false if it isn't?

thanks

Violet_82 89 Posting Whiz in Training

HI all, I am trying to validate the input in my tic-tac-toe program. I had a good look around on the net and tried a few combinations, but I couldn't get anywhere. Some people seem to be using methods like hasNextInt(), some other a try and catch statement.
I tried first with a hasNextInt(), something like this:

while( !input.hasNextInt()){
            System.out.print("This is not an int, please insert an int now");

            input.nextInt();
        }

So, here's the tic-tac-toe program and then I will explain where I inserted the supposed validation
http://ideone.com/wIk4mu
http://ideone.com/zZlIVa
SO this is the first validation attempt (I just added it for one input only but, if correct I will have to do it for both inputs):

if( !(myTicTacToe.isOdd( playerCounter ))){//player 1
                System.out.println( "\nPlayer 1: enter the coordinates of the square.\nRow and column - values between 1 and 3." );
            }
            else{//player 2
                System.out.println( "\nPlayer 2: enter the coordinates of the square.\nRow and column - values between 1 and 3." );
            }
            System.out.println( "\nRow and press enter: " );
            rowInput = input.nextInt();
            System.out.println( "\nColumn and press enter: " );
            colInput = input.nextInt();
            /*
            while( !input.hasNextInt()){
            System.out.print("This is not an int, please insert an int now");

            input.nextInt();
        }
            */
            rowInput = myTicTacToe.optimizeInput( rowInput );//to subtract 1 from the input
            colInput = myTicTacToe.optimizeInput( colInput );//to subtract 1 from the input

Then I tried with a try catch block. I have never used a try catch before, so I think I might …

Violet_82 89 Posting Whiz in Training

ok fab, will do that, thanks a lot for your help!

Violet_82 89 Posting Whiz in Training

I am happy to do it, sure. I will gather some info, have a look online and try to understand what to do, but I suspect I will need some help with it considering what I have seen so far. I will give it a go first of course. Should I start a new thread just for validation? It probably makes sense!

Violet_82 89 Posting Whiz in Training

right so essentially the width is a kind of tipping point before which the output is forced to justify.
I was just wondering, do you guys reckon Ishould test the input as well? I mean I have no idea how to it at this stage, but do you think it is something I should look into and implement on the program? So something like if users insert a letter or a number bigger than 3 they get a message saying input non valid try again?

Violet_82 89 Posting Whiz in Training

Fab thanks. I have changed the boolean variable to a the one you suggested and I have used the printf as indicated, it works great. Can I ask you a few questions about it? Like, that 6 number means that it will print 6 characters right? If it's less than 6 it will justify the text on the right?

Violet_82 89 Posting Whiz in Training

ah yes, it does! thanks JorgeM, I hope you don't mind if I ask you a bit more about that. You seem to have used a combination of float, and left margin. My mistake in one of my attempts was to leave the top margin in there and that didn't work. Is the value you gav to the left margin arbitrary? So as long as I give the input a left float and the label a left margin and display as block it will work?
thanks

Violet_82 89 Posting Whiz in Training

Hi all, I have just finished with my tict-tac-toe program, and I thought I'd post it here if anybody fancy giving
me any feedback. Also, I have a problem with printing the board, probably due to my lack of knowledge in using printf as opposed to println.
Anyway this is the method that prints off the board:

//print board
public void printBoard(){
    System.out.print("\n\n\n\n\n");
    System.out.println("|   " + board[0][0] + "   |   " + board[0][1] + "   |   " + board[0][2] + "   |");
    System.out.println("|   " + board[1][0] + "   |   " + board[1][1] + "   |   " + board[1][2] + "   |");
    System.out.println("|   " + board[2][0] + "   |   " + board[2][1] + "   |   " + board[2][2] + "   |");
    System.out.print("\n\n\n\n\n");
    /* System.out.printf( "%s%d%s%d%s%d%s " ) */
}

Let me give you a bit of background info first: if a square is empty it will have EMPTY printed on it, otherwise it will get a X or a O. I bet you can see the problem already. If an EMPTY is replaced by a X or O the layout of my board is completely messed up:

|   EMPTY   |   0   |   EMPTY   |
|   EMPTY   |   EMPTY   |   EMPTY   |
|   EMPTY   |   EMPTY   |   EMPTY   |

So I have to try to make sure that the same space is preserved whether I have a symbol or an EMPTY in there.
I know I have to use the printf method to achieve that …

Violet_82 89 Posting Whiz in Training

Hi all, I hope somebody can help me with this really annoying issue. Basically I have a some radio buttons and some text inside a label. This is in a small container and when the line of text breaks and goes to the other line, I want it to be below the text and not the radion button, so in short to increase the indentation.
I have spent a few hours on this but I can't get it right. I have tried an awful lot of combinations (and things suggested on stackoverflow too) but for the life of me I couldn't get it to work. Here's the code and 2534aeb83c2b7f8d368ca9c29fe914d8 a screenshot of how the layout looks like at the moment.
This is the relevant html:

    <div class="myform">
            <div class="column1">
                <p>lorem ipsum?</p>
            </div>
            <div class="column2">
                <span>
                    <input id="question0" name="question" value="Yes" type="radio"><label for="question0">Yes</label>
                    <br><input id="question1" name="question" value="latin 1" type="radio"><label for="question1">No, onsectetur adipiscing elit. Inte</label>
                    <br><input id="question2" name="question" value="latin 2" type="radio"><label for="question2">onsectetur adipiscing elit. Inteonsectetur adipiscing elit. Inte</label>
                    <br><input id="question3" name="question" value="latin 3" type="radio"><label for="question3">onsectetur adipiscing elit. Inte adipiscing elit </label>
                </span>
            </div>
        </div>

And css:

/*radio buttons*/
.column1{
    border:1px solid transparent;
    width:26.1437908496732%; /*200/765*/
    float:left; 
}

.column2{
    border:3px solid magenta;
    width:249px;
    float:left;
    font-size: 0.875em;
    padding:0 20px 0;
}
.column2 input[type="radio"]{
    margin-top: 20px;   
}
/* .column2 span label{
    display:inline;
} */
.column2 select, .column2 input{
    margin-top:20px;
}
.column2.noWidth{
    width:auto;
    /* margin-top:20px; */
}

/*radio buttons*/

Now, you might say that the code …

Violet_82 89 Posting Whiz in Training

ok thanks guys!

Violet_82 89 Posting Whiz in Training

ah ok, I don't know I just thought this was incorrect, sorry!

if((variable1) && (variable2)){
    //do this and that
}

So if the above is fine then even this would be ok:

if((variable1) && !(variable2)){
    //do this and that
}

I just thought that if there is more than a variable involved I had to explicitly test the variables

Violet_82 89 Posting Whiz in Training

Hi guys, I am not sure this is right or not.
If I have one variable whose value is true or false and I want to use it in an if statement I could easily do

if(variable1){
    //do this and that
}

but I want to check 2 variables I assume I will have to explicitly test whether they are true or false like so

if((variable1 == true) && (variable2 == true)){
    //do this and that
}

I can't have a situation like

if((variable1) && (variable2)){
    //do this and that
}

correct?

Violet_82 89 Posting Whiz in Training

thanks jwenting.

as you might have multiple forms on a page, with the same form elements on each, being submitted under different names to the server, which would get broken by this system.

That did cross my mind, but for now I don't seem to have multiple forms luckily, all my forms are just divided into different section and they all have one submit button. If the client wants to add multiple forms, I have no idea how that, and if, can be handled.

Also I was wondering, isn't this way - adding a form tag straight after the body tag - of handling content semantically incorrect? I mean I assume the code validates but having what's not a form inside a form tag doesn't strike me to be the best thing to do

Violet_82 89 Posting Whiz in Training

Hi chaps,
quick question. Is a html form tag always required when you add a form to the html? In other words if you have a form and leave out the form tag will the code still validate? I have heard some saying that a form tag is only necessary if the form passes data to the server or something like that. The reason for the question is that when I develop a web page for a CMS - sorry can't remember the name of this cms off the top of my head - it adds its own form tag straight after the body tag, whether there is a form or not, so that all the content after the body tag is effectively contained inside a form tag. The problem is that this cms accepts only 1 form tag, so if I happen to have a form in my html I can't use the tag anymore (if you try to use it the cms replaces it with a normal div, I don't know whether this is a bug that came with it or a feature)
thanks

Violet_82 89 Posting Whiz in Training

ok, then local variables will be!
thanks

Violet_82 89 Posting Whiz in Training

ok fair enough, thanks for clarifying that.
Yes I get confused sometimes between methods and functions, that's what happen when you do javascript as well!
thanks

Violet_82 89 Posting Whiz in Training

ok sounds good to me.
I must admit I was a bit confused, because at the beginning I did include the row and column as attributes of the board, because at the end of the day they somehow 'describe' a single cell giving its position. But on the other hand, it felt euqlly good to have them as instance variables...I really had no idea what to do. But also as stultuske pointed out, using getters and setters promote encapsulation and I remember this is also another key thing that many programmers, quite rightly I think, are very keen on. So in essence I really didn't know what to do!

Violet_82 89 Posting Whiz in Training

it is something similar to that. ok here's the code (I didn't post it before because i thought we could do with just a sample).
this is the file with methods and classes:

/*TicTacToe.java*/
public class TicTacToe{     
    private TicTacToeEn[][] board = new TicTacToeEn[3][3];//to represent the 3-by-3 board
    private int row;//row of the 3-by-3 board
    private int column;//column of the 3-by-3 board         

    public enum TicTacToeEn{
        X, O, EMPTY 
    }//end of enum
    TicTacToeEn theSymbol;//of type enum holds the current theSymbol, X or O 
    //constructor
    public TicTacToe(){
        for( int i = 0; i < board.length; i++ ){
            for( int j = 0; j < board[i].length; j++ ){
                board[i][j] = TicTacToeEn.EMPTY;
            }//columns
        }//rows         
    }//end of constructor

    //row setter    
    public void setRow( int theRow ){
        row = theRow;       
    }
    //column setter
    public void setColumn( int theColumn ){
        column = theColumn;
    }

    //checks if square is empty
    public boolean checkSquare(int number1, int number2){
        if(board[number1][number2] == TicTacToeEn.EMPTY){
            return false;
        }
        else{
            return true;
        }       
    }//end of checkSquare()
    ...

here's the test file (but I haven't developed the whole thing as yet, still working on it, and there will be calls to methods etc)

/*TicTacToeTest.java*/
import java.util.Scanner;

public class TicTacToeTest{
    boolean isFull = false;//if true all the squares have been assigned.
    boolean isDraw = false;//to check if the game is draw
    boolean squareStatus = false;//returns the status of a square, if false the square is full if true the square is empty
    boolean victory = false;//if returns true one of the players has won …