import javax.swing.*;
import java.awt.*;

/* <applet code="Othello.class" width="480" height="480"></applet> */

public class Othello extends JApplet {
  int scale = 40;
  int space = 3;
  int size = 8;
  int[][] state = {{0,1,2,0,1,2,0,1}, {2,0,1,2,0,1,2,0}, {1,2,0,1,2,0,1,2},
	           {0,1,2,0,1,2,0,1}, {2,0,1,2,0,1,2,0}, {1,2,0,1,2,0,1,2},
	           {0,1,2,0,1,2,0,1}, {2,0,1,2,0,1,2,0}};

  @Override  
  public void paint(Graphics g) {
    int i,j;
    
    for (i=0; i<8; i++) {
      for (j=0; j<8; j++) {
	g.setColor(Color.GREEN);
	g.fillRect(i*scale, j*scale, scale, scale);
	g.setColor(Color.BLACK);
	g.drawRect(i*scale, j*scale, scale, scale);
	if (state[i][j]==1) {
	  g.setColor(Color.WHITE);
	  g.fillOval(i*scale+space, j*scale+space, scale-space*2, scale-space*2);
	} else if (state[i][j]==2) {
	  g.setColor(Color.BLACK);
	  g.fillOval(i*scale+space, j*scale+space, scale-space*2, scale-space*2);
	}
      } 
    }
  }

/*
  public static void main(String args[]) {
    JFrame f;
    JApplet a;

    f = new JFrame();
    a = new Othello();     // $B8=:_!"Dj5A$7$F$$$k%/%i%9$N%3%s%9%H%i%/%?(B
    a.init();              // $B%"%W%l%C%H$r=i4|2=(B

    f.getContentPane().add(a);
    f.setDefaultCloseOperation(3);
    f.setSize(330, 360);   // $B%"%W%l%C%H$h$j$b>/$7Bg$-$a$N%5%$%:$K$9$k!#(B
    f.setVisible(true);

    // $BI,MW$J$i(B a.start()$B$r8F$V(B
  }
 */
}
