public void DrawMaze(Graphics g,int width,int height,int xoffset,int yoffset) {
	// start with all wall
	//g.setColor(getBackground());
	//g.fillRect(xoffset,yoffset,width,height);

	// choose a building block that's a multiple of MARK
	csize = Math.min(width/ncols,height/nrows);
	csize -= csize % MARK;
	xoffset += (width - csize*ncols) >> 1;
	yoffset += (height - csize*nrows) >> 1;

	// clear out passageways
	int index = 0;
	for (int r = 0; r < nrows; r += 1)
	    for (int c = 0; c < ncols; c += 1) {
		int x = xoffset + c*csize;
		int y = yoffset + r*csize;
		int mch = map[index++];
		if (mch == 'X') continue;	// wall

		g.setColor(Color.white);
		g.fillRect(x,y,csize,csize);

		if (mch == 'f') {
		    g.setColor(Color.magenta);
		    int w = csize >> 2;
		    g.fillOval(x+w,y+w,csize-w-w,csize-w-w);
		}

		// draw marks
		for (int i = 0; i < MARK; i += 1)
		    for (int j = 0; j < MARK; j += 1) 
			DrawMark(g,r,c,xoffset,yoffset,i,j);
	    }

	// paint ant
	if (antX > 0 && antY > 0) {
	    int x = xoffset + (int)(antX * csize);
	    int y = yoffset + (int)(antY * csize);
	    int h = csize/6;
	    g.setColor(Color.green);
	    g.fillOval(x-h,y-h,h+h,h+h);

	    DrawAntenna(g,x,y,antAngle + ARIGHT,antR);
	    DrawAntenna(g,x,y,antAngle + ALEFT,antL);
	}

	/*
	// draw grid
	g.setColor(Color.black);
	for (int r = 0; r <= nrows; r += 1)
	    g.drawLine(xoffset,yoffset + r*csize,
		       xoffset + ncols*csize,yoffset + r*csize);
	for (int c = 0; c <= ncols; c += 1)
	    g.drawLine(xoffset + c*csize,yoffset,
		       xoffset + c*csize,yoffset + nrows*csize);
	*/
    }