#include <math.h>
int*q ,C[]={ 0,3,6,3,12,3,18,
3,0 ,9, 6,9 ,12, 9,18
,9,0 ,0} ,O[]= {0 ,6 ,6 ,6
,12,6 ,18 ,6, 0, 12 ,0, 24 ,0,
0},T[]={ 0,12 ,0, 4, 8, 4, 16,4,
0, 0}, *e, X[ ]= {0, 4, 2,6 ,8
,10, 0, 0} ,Q [] ={0 ,2, 2,
4, 4,6 ,6 ,0, 8, 10,10 ,12
,8 ,14 ,12, 14, 0,8 ,2,
10 ,4 , 12,6, 14 ,0 ,0 },
A[ ]= {0,8 ,2,8,4, 8,6,8,0 ,10 ,2
,10 ,4, 10,6,10,0,2,2, 4,4 ,6,6 ,0 ,0
,0 }, K[] = {0 ,2, 0,4, 0,6,
2,4 ,4,6,6,2,0,0 }, i,j ,w
,h ,k ,u,v ,_; double c, t,
p, r,f,g, l,m,n ,o ,x[16 ],
y[16 ],z[16 ];char s[256 ][1 <<
8] ;main( int a0, char**b) {w= a0
>1 ? atoi(b[ 1]): 79 ; h= a0 >2? 0+
atoi (b[2]): 23;if (!(w< +20 ||
w>256 ||h<20 ||h> 256) ){k =(
w> h? h:w)/2; srand( time (0
));u= rand()% 24; v= rand ()
%24;c= atan2( 0, -1)/ 12
;for(i =0;i<h ;i++ )for (j
=0;j<w ;s[i][j ++]= 32
);q= (( i= rand())& 1)?(i&2) ?C:T: O ;e
=(i& 1) ?( i&2) ?Q: K: (i &2)? A: X;
for( i= 0;q[ i]+q [i+1 ]> 0; i+=2 ){ x[
i]=( r= sin( p=q [i +1 ]*c ))*cos (t= (q
[i] +v )*c)* 1.5 ;z [i]= cos(p);y[ i]=r * sin
(t) ;r =u *c ;t =+ cos(r)*y[i ]-sin (r)* z[ i]
;z[ i] = sin (r) *z [i] +cos (r )* y[ i]
;y [i]=t ;} for (i =0; (u =e[i] )-
(v= e[i+ 1] ); i= i+2) {f =x [u] ;m
=x [v] ;g =y[ u] ;n= y[v ];l=z[ u]
;o =z [v ];for (j=0 ;128 >j;j++) s[
( int) (( g+ j*( n-g)/ 128) *k +h
/2)][( int)( (f +j*( m- f)/+ 128)*
k+ w/2)]=(l +j* (o-l )/ 128 )< 0?+
46 : 120;}; for(i= 0 ;i <h ;i++)
{for ( j=0; j < w; putchar
(s [ i] [j ++ ])); putchar
( 10 ); }}}
|