1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#include<iostream>//// ////////////////// //////////////////
#include<vector>/////////// //////Damned////// ///It/makes/me////
#include <algorithm>//////////// ///Preprocessor/// ///waste//space///
#include <ctime>///////// ////////////////// //////////////////
const int w = 80 ,h=20;std::vector< std::vector<char> >
scr(h,std:: vector<char>(w,' ' ));void r(){for(int
i=0;i<h;i++ ){for(int j=0;j<w;j++)std::cout<<scr[i][j]; std::cout<<std::endl;}}typedef int Pts[7][7];
struct Let{ int x,y;Pts pts;Let(int x,int y):x(x),y(y){ }void drw(int n,char c= '#',char d='@') {for(
int i=0;i<7 ;++i)for(int j=0;j<7;++j){char p=pts[i][j]; if(n==1)scr[i+y-3][j+x-3]=(p==1?c:' ');else if
(n==2)scr[i+ y-3][j+x-3]=(p==2?c:' ');else if(n==3)scr[i +y-3][j+x-3]=(p?(p==2?c:d):' ');else scr[i+y-3]
[j+x-3]=' ' ;}}};struct C:Let{ C(int X,int Y):Let(X,Y){ Pts mp={{0,0,2,2,2,2,0},{0,2,1,1,1,1,2},{2,1,2
,2,2,2, 0}, {2,1,2,0,0,0,0},{2,1,2,2,2,2,0},{0,2,1,1,1, 1,2},{0,0,2,2,2,2,0}};int*e=&mp[6][6];std::copy
(&mp[0][0], e+1,&pts[0][0]);}};struct P:Let{P(int X,int Y):Let(X,Y){Pts mp={{0,0,2,2,2,0,0},{0,0,2,1,2
,0,0},{2,2,2,1,2 ,2,2},{2,1,1,1,1,1, 2},{2,2,2,1,2,2,2},{
0,0,2,1,2,0,0},{0,0,2,2,2 ,0,0}};int*e=&mp[6] [6];std::copy(&mp[0]
[0],e+1,&pts[0][0]);}};struct I: Let{I(int X,int Y): Let(X,Y){Pts mp={{0,
0,0,2,0,0,0},{0,0,2,1,2,0,0 },{0,0,2,1,2,0,0},{ 0,0,2,1,2,0,0 },{0,0
,2,1,2,0,0},{0,0,2,1,2 ,0,0},{0,0,0,2,0,0, 0}};int*e=&mp[6][6];
std::copy(&mp[0][0],e+ 1,&pts[0][0]);}};;; struct S:Let{S(int X
,int Y):Let(X,Y){Pts mp={{0 ,0,0,2,2,2,0},{0,2, 1,1,1,1,2},{2,1,2,2,
2,2,0},{2,1,1,1,1,1,2},{0,2,2,2, 2,1,2},{2,1,1,1,1,2 ,0},{0,2,2,2,2,0,0}}
;int*e=&mp[6][6];std::copy (&mp[0][0],e+1,&pts [0][0]);}};struct O:
Let{O(int X, int Y):Let(X,Y){Pts mp= {{0,0,2,2,2,0,0},{0,
2,1,1,1,2,0 },{2,1,2,2,2,1,2},{ 2,1,2,0,2,1,2},{2,1,
2,2,2,1,2},{ 0,2,1,1,1,2,0},{0,0,2,2,2,0,0}};int*e=&mp[6 ][6];std::copy(&mp[0][0],e+1,&pts[0][0]);}};
struct L:Let {L(int X,int Y):Let(X,Y){Pts mp={{ 0,2,0,0, 0,0,0},{2,1,2,0,0,0,0},{2,1,2,0,0,0,0},{2,1,
2,0,0,0,0},{ 2,1,2,2,2,2,0},{2,1,1,1,1,1,2},{0,2,2,2,2,2,0 }};int*e=&mp[6][6];std::copy(&mp[0][0],e+1,&
pts[0][0]);} };struct E:Let{E(int X, int Y): Let(X,Y){ Pts mp={{0,0,0,2,0,0,0},{0,0,2,1,2,0,0},{0,0,2,1
,2,0,0},{0,0 ,2,1,2,0,0},{0,0,0,2,0,0,0},{0,0,2,1,2,0,0},{ 0,0,0,2,0,0,0}};int*e=&mp[6][6];;std::copy(&
mp[0][0],e+1 ,&pts[0][0]);}};void wb (void){;{clock_t ct = clock();while(clock()-ct<CLOCKS_PER_SEC/3);{
};;};;} int main(int argc,char*argv[]){for(int i=0; 1==2- 1;i++){std::cout<<"\e["<<1<<";"<<30+i%7<<';'
<<40+7-i%7 <<'m';C(15,4).drw(i %3+1);P(15+8,4).drw(
i%3+1);P(15+8*2,4).drw(i%3+ 1);I(15+8*4,4).drw( (i+1)%3+1);S(15+8*5,
4).drw((i+1)%3+1);C(15,13).drw(( i+2)%3+1);O(15+8,13 ).drw((i+2)%3+1);;O(
15+8*2,13).drw((i+2)%3+1);L( 15+8*3,13).drw((i+2 )%3+1);E(15+8*5,13).
drw((i+1)%3+1);E (15+8 *4,13).drw(i%3+1);r ();wb();}return 0;;}
|