Thanks Mark,
I am reasonably sure there is nothing wrong with setBoard(); but I may be
wrong so here is setVoard():
private void setBoard() {
ai = new AI();
b = new Button[4][4];
c = new int[4][4];
won = (TextView) findViewById(R.id.won);
drawn = (TextView) findViewById(R.id.drawn);
lost = (TextView) findViewById(R.id.lost);
textView = (TextView) findViewById(R.id.dialogue);
b[1][3] = (Button) findViewById(R.id.one);
b[1][2] = (Button) findViewById(R.id.two);
b[1][1] = (Button) findViewById(R.id.three);
b[2][3] = (Button) findViewById(R.id.four);
b[2][2] = (Button) findViewById(R.id.five);
b[2][1] = (Button) findViewById(R.id.six);
b[3][3] = (Button) findViewById(R.id.seven);
b[3][2] = (Button) findViewById(R.id.eight);
b[3][1] = (Button) findViewById(R.id.nine);
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 3; j++)
c[i][j] = 2;
}
AdView adView = (AdView)findViewById(R.id.ad);
adView.requestFreshAd();
textView.setText("Touch a button to start.");
won.setText("Won: " + wins);
lost.setText("Lost: " + loses);
drawn.setText("Drawn: " + draws);
// add the click listeners for each button
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 3; j++) {
b[i][j].setOnClickListener(new MyClickListener(i, j));
if(!b[i][j].isEnabled()) {
b[i][j].setText(" ");
b[i][j].setEnabled(true);
}
}
}
}
Please tell me if you see anything wrong. Also Since I am testing on actual
hardware and not an emulator how to I write to the log file and where is it
located?
Thanks
--
Raghav Sood
http://www.raghavsood.com/
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en