⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 make_stone.c

📁 用linuX 下的C语言 运用CURSES编写的俄罗斯方块游戏
💻 C
字号:
#include"header.c"
void make_stone(int stone_s[stone_type][stone_view][stone_x][stone_y],int *type,int *view)
{
   int x,y;
       for(*type=0;*type<stone_type;(*type)++)
            for(*view=0;*view<stone_view;(*view)++)
                  for(x=0;x<stone_x;x++)
                         for(y=0;y<stone_y;y++)
                 stone_s[*type][*view][x][y]=0;

//struct the stone   ##
//d..                ##
	*type=1;
     for(*view=0;*view<4;(*view)++)
       for(x=0;x<2;x++)
             for(y=0;y<2;y++)          
                stone_s[*type][*view][x][y]=1;
//stone ####                        
    *type=2;*view=0;
         for(y=0;y<4;y++)
              stone_s[*type][*view][0][y]=2;
    *type=2;*view=1;
         for(x=0;x<4;x++)
              stone_s[*type][*view][x][0]=2;
    *type=2;*view=2;
         for(y=0;y<4;y++)
              stone_s[*type][*view][0][y]=2;
    *type=2;*view=3;
         for(x=0;x<4;x++)
              stone_s[*type][*view][x][0]=2;
//stone  ##
//d       ##
     *type=3;*view=0;
         for(y=0;y<2;y++)
              stone_s[*type][*view][0][y]=3;
         for(y=1;y<3;y++)
              stone_s[*type][*view][1][y]=3;
     *type=3;*view=1;
           stone_s[*type][*view][0][1]=3;
              for(y=0;y<2;y++)
           stone_s[*type][*view][1][y]=3;
           stone_s[*type][*view][2][0]=3;
	*type=3;*view=2;
         for(y=0;y<2;y++)
              stone_s[*type][*view][0][y]=3;
         for(y=1;y<3;y++)
              stone_s[*type][*view][1][y]=3;
	*type=3;*view=3;
           stone_s[*type][*view][0][1]=3;
              for(y=0;y<2;y++)
           stone_s[*type][*view][1][y]=3;
           stone_s[*type][*view][2][0]=3;
//stone      ##
//d         ##
       *type=4;*view=0;
         for(y=1;y<3;y++)
              stone_s[*type][*view][0][y]=3;
         for(y=0;y<2;y++)
              stone_s[*type][*view][1][y]=3;
     *type=4;*view=1;
           stone_s[*type][*view][0][0]=3;
              for(y=0;y<2;y++)
           stone_s[*type][*view][1][y]=3;
           stone_s[*type][*view][2][1]=3;
       *type=4;*view=2;
         for(y=1;y<3;y++)
              stone_s[*type][*view][0][y]=3;
         for(y=0;y<2;y++)
              stone_s[*type][*view][1][y]=3;
     *type=4;*view=3;
           stone_s[*type][*view][0][0]=3;
              for(y=0;y<2;y++)
           stone_s[*type][*view][1][y]=3;
           stone_s[*type][*view][2][1]=3;

//stone     ###
//d           #
       *type=5;*view=0;
          {
            for(y=0;y<3;y++)
              stone_s[*type][*view][0][y]=4;
              stone_s[*type][*view][1][2]=4;                
          } 
       *type=5;*view=1;
         {
             stone_s[*type][*view][0][1]=4;
             stone_s[*type][*view][1][1]=4;
            for(y=0;y<2;y++)
             stone_s[*type][*view][2][y]=4;
         }
      *type=5;*view=2;
          {
            for(y=0;y<3;y++)
              stone_s[*type][*view][1][y]=4;
              stone_s[*type][*view][0][0]=4;                
          } 
      *type=5;*view=3;
         {
             stone_s[*type][*view][0][1]=4;
            for(x=0;x<3;x++)
             stone_s[*type][*view][x][0]=4;
         }
//stone     ###
//d         #
       *type=6;*view=0;
          {
            for(y=0;y<3;y++)
              stone_s[*type][*view][0][y]=4;
              stone_s[*type][*view][1][0]=4;                
          } 
       *type=6;*view=3;
         {
          
             stone_s[*type][*view][0][0]=4;
              for(x=0;x<3;x++)
            stone_s[*type][*view][x][1]=4;           
         }
      *type=6;*view=2;
          {
            for(y=0;y<3;y++)
              stone_s[*type][*view][1][y]=4;
              stone_s[*type][*view][0][2]=4;                
          } 
      *type=6;*view=1;
         {
             stone_s[*type][*view][2][1]=4;
            for(x=0;x<3;x++)
             stone_s[*type][*view][x][0]=4;
         } 
//stone      ###
//d           #
        *type=0;*view=2;
          {
                stone_s[*type][*view][0][1]=5;
                  for(y=0;y<3;y++)
                     stone_s[*type][*view][1][y]=5;
          }
        *type=0;*view=1;
          {
                  for(x=0;x<3;x++)
                      stone_s[*type][*view][x][0]=5;
                  stone_s[*type][*view][1][1]=5;
           } 
        *type=0;*view=0;
           {
                  for(y=0;y<3;y++)
                    stone_s[*type][*view][0][y]=5;
                stone_s[*type][*view][1][1]=5;
            }
         *type=0;*view=3;
           {
                 
                      for(x=0;x<3;x++)
                    stone_s[*type][*view][x][1]=5;
               stone_s[*type][*view][1][0]=5;
            }
                          
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -