My goal is to have the user input a number N and the size of the arrayList be 2N + 1.
Ultimately my arrayList for N=2 should be "OO XX".
public Board(int size)
{
tiles = new ArrayList<Tile>(size);
for(int index = 0; index < size; index++)
{
tiles.add(new Tile('O'));
tiles.add(new Tile(' '));
tiles.add(new Tile('X'));
System.out.print(tiles.get(index));
}
}
The above code gives me "O XO". How can I modify it to show me OO XX ?
Thanks ahead!