#include <stdio.h>
#include <math.h>
#include "svg.h"

#define YOKO 12
#define TATE 17

char barColor1[] = "rgb(148,189,94)";
char barColor2[] = "rgb(94,148,189)";

int main(void){
    int i,j;
    int width=8;
    int height=8;
    //白：０、赤：１、緑：２、肌：３
    int map[TATE][YOKO]={
        {0,0,0,1,1,1,1,1,0,0,0,0},
        {0,0,1,1,1,1,1,1,1,1,1,0},
        {0,0,2,2,2,3,3,2,3,0,0,0},
        {0,2,3,2,3,3,3,2,3,3,3,0},
        {0,2,3,2,2,3,3,3,2,3,3,3},
        {0,2,2,3,3,3,3,2,2,2,2,0},
        {0,0,0,3,3,3,3,3,3,3,0,0},
        {0,0,2,2,1,2,2,2,0,0,0,0},
        {0,2,2,2,1,2,2,1,2,2,2,0},
        {2,2,2,2,1,1,1,1,2,2,2,2},
        {3,3,2,1,3,1,1,3,1,2,3,3},
        {3,3,3,1,1,1,1,1,1,3,3,3},
        {3,3,1,1,1,1,1,1,1,1,3,3},
        {0,0,1,1,1,1,1,1,1,1,0,0},
        {0,0,1,1,1,0,0,1,1,1,0,0},
        {0,2,2,2,0,0,0,0,2,2,2,0},
        {2,2,2,2,0,0,0,0,2,2,2,2}
    };
    
    start();
    rulers();
        
    for(i=0;i<TATE;i++){
        for(j=0;j<YOKO;j++){
            switch(map[i][j]){
            case 0: //白
                stroke(0xffffff);
                fill(0xffffff);
                break;
            case 1: //赤
                stroke(0xdc2900);
                fill(0xdc2900);
                break;
            case 2: //緑
                stroke(0x8b7d00);
                fill(0x8b7d00);
                break;
            case 3: //肌
                stroke(0xffa53b);
                fill(0xffa53b);
                break;
            }
            rect(j*width+80, i*height+40, width, height);
        }
    }
    finish();
    return 0;
}
