simple rainbow by smkt

#define P printf(
#define W (c-w)-6+r+a
R(int c,int n){int i=0;for(;i<n;i++,putchar(c));}main(c,a,w,o,r){scanf("%d",&c);w=c;for(a=o=0;o<4;a++)R(' ',w),a<1?R('R',r=c*2):a==1?P"R"),R('G',r),P"R"):a==2?P"RG"),R('B',r),P"GR"):a>2&o<2?P"RGB"),R(' ',W),P"BGR"):o==2?P"GB"),R(' ',W),P"BG"):o==3?P"B"),R(' ',W),P"B"):0,puts(""),--w<1?o++:0;}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page