#define LINE_PATTERN

    "****************************************"

    "****************************************"


void draw_otho_triangle(int n, int v, int space_n = 1, int space_v = 0)

{

    char line[] = LINE_PATTERN;

    char* ptr = line + sizeof line - 2;


    ptr -= (n << -v - 1) + v & ((v < 0) << 31 >> 31);

    ptr[(-n << v - 1) & ((v > 0) << 31 >> 31)] = "*"[v > 0];


    for(; *ptr; ptr -= v, space_n += space_v)

    {

        printf("%*c", space_n);

        puts(ptr);

    }

}


void draw_diamond(int n)

{

    draw_otho_triangle(n    ,  2, n    , -1);

    draw_otho_triangle(n - 1, -2, 1 + 1,  1);

}


조건 연산자야 조건 연산자니까 싫으면 뺄셈도 쓰지말아야지.

하지만 이렇게 짜면 if 보다 비싸지.