import static util.SVGUtil.*;

public class MathFun {
    private static final int charRange[][] = {
	{ 0x2660, 0x266f },
	{ 0x2bc0, 0x2bc4 }
    };
    private static int current = 0;
    private static final int nRanges = charRange.length;
    private static int c = -1;
    
	private static int nextChar() {
	    int nextC;     
	    if (c == -1) {
	        c = charRange[current][0];
	    }   
	    nextC = c++;
	    if (c > charRange[current][1]) {
	        current++;
	        if (current >= nRanges) {
	            current = 0;
	        }    
	        c = charRange[current][0];
	    }   
	        
	    return nextC;
	}

	public static void main(String[] args) {
	    int i, j;
	    double x0 = 20, y0 = 95;

	    start();
	    rulers();
	    textFont("Segoe UI Symbol", 8);             /* フォントとサイズ */
	    for (i = 0; i < 6; i++) {
	        for (j = 0; j < 32; j++) {
	            double x = j / 4.5;   
	            double y = (1 - i / 12.0) * Math.sin(x); 
	            fill(hsb1((2 * i + j) / 32.0, 1, 1));
	            text("&#x%x;", x0 + x * 28, y0 - 50 * y, nextChar());
	        }
	        x0 += 10; y0 += 5; 
	    }
	    finish();
	}

}
