小女也爱c#(3)--俄罗斯方块练习数组

学完c了,总算是有点收获了,自己写了个俄罗斯方块练习数组,在vc6.0控制台环境下编译通过.

ContractedBlock.gifExpandedBlockStart.gifmakehead.h
int Makepanel(char Ary_Panel[][10]);
void gotoxy(int x, int y);
void BrushsScreen(char ary[][20]);
int initializationShape();
void ShowShape(char ary_shapel[][3][3],int nType,int *x, int *y,char Arry_recordXY);
int isNotLandDown(char ary_Panel[][20],char ary_shapel[][3][3],int nType,int *x,int *y);
void SetDownLandStatus(char ary_shapel[][3][3],int nType);
void RemoveRow(char ary_Panel[][23]);
void BrushsScreen2(char Arry_recordXY[][3][2]);
void Cls_Arry_recordXY(char Arry_recordXY[][3][2]);
int isCollision_left(char ary_Panel[][23],char ary_shapel[][3][3] ,int x, int y,int nType);
void Block_Turn(char ary_shapel[][3][3],int nType);
void DownRow(char ary_Panel[][20],int k);
char key(int s);
int isBlock_Turn(char ary_Panel[][20],char ary_shapel[][3][3],int nType,int x,int y);
int isCollision_right(char ary_Panel[][20],char ary_shapel[][3][3] ,int x, int y,int nType);
void GameOver();
int isGameOver(int x);
void Stop();
int maxDown(char ary_Panel[][20],int x,int y);
#define ShapeType 10

 

#include <windows.h>
#include<stdio.h>
#include<conio.h>
#define Nop	0
#define Wall	1
#define Solid	2
#define Landing 3//函数名&功能:显示主界面显示
//参数:主界面的二维数组
//返回值:intint Makepanel(char Ary_Panel[][20])
{int i=0,j=0;for(i=0,j=0;i<23;i++){for(j=0;j<20;j++){if(j==0||j==19||i==22){Ary_Panel[i][j]=1;}else{Ary_Panel[i][j]=0; }if(Ary_Panel[i][j]==Wall){printf("⊙");}else if(Ary_Panel[i][j]==Nop){printf("  ");}if(j==19){printf("\r\n");}}}printf("上下左右->wsad,暂停为空格键");return 0;
}//函数名&功能:移动到x,y点
//参数:x,y为坐标
//返回值:voidvoid gotoxy(int x, int y)
{COORD point;point.X = x; point.Y = y;SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), point);
}//函数名&功能:刷新屏目
//参数:x,y为坐标
//返回值:voidvoid BrushsScreen(char ary[][20],int x,int y)
{int i=0,j=0;for(i=0;i<23;i++){for(j=1;j<19;j++){gotoxy(j+j,i);if(ary[i][j]==Nop){printf("  ");}}}
}//函数名&功能:刷新屏目
//参数:x,y为坐标
//返回值:voidvoid BrushsScreen2(char Arry_recordXY[][3][2])
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){ if(Arry_recordXY[i][j][0]!=0 || Arry_recordXY[i][j][1]!=0){gotoxy(Arry_recordXY[i][j][1],Arry_recordXY[i][j][0]);printf("  ");Arry_recordXY[i][j][0]=0x00;Arry_recordXY[i][j][1]=0x00;}}}
}//函数名&功能:方块初始化
//参数:x,y为坐标
//返回值:voidint initializationShape()
{int nType=0,i=0,j=0;srand( (unsigned)time( NULL ) );nType = rand() % 10;return nType;
}//函数名&功能:刷新显示方块边上的区域
//参数:x,y为坐标
//返回值:voidvoid ShowShape(char ary_shapel[][3][3],int nType,int *x, int *y,char Arry_recordXY[][3][2])
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){if(ary_shapel[nType][i][j]==Solid){if(i==0 && j==0 && (*x-1)>=0){//打印原点左边上方的点gotoxy((*y+*y-2),*x-1);printf("■");Arry_recordXY[i][j][0]=*x-1;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y-2;}else if(i==0 && j==1 && (*x-1)>=0){//打印原点上方的点gotoxy((*y+*y),*x-1);printf("■");Arry_recordXY[i][j][0]=*x-1;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y;}else if(i==0 && j==2 && (*x-1)>=0){//打印原点右边上方的点gotoxy((*y+*y+2),*x-1);printf("■");Arry_recordXY[i][j][0]=*x-1;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y+2;}else if(i==1 && j==0 && *x>=0){//打印原点左边的点gotoxy((*y+*y-2),*x);printf("■");Arry_recordXY[i][j][0]=*x;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y-2;}else if(i==1 && j==1 && *x>=0){gotoxy((*y+*y),*x);//打印原点printf("■");Arry_recordXY[i][j][0]=*x;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y;}else if(i==1 && j==2 && *x>=0){//打印原点右边的点gotoxy((*y+*y+2),*x);printf("■");Arry_recordXY[i][j][0]=*x;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y+2;}else if(i==2 && j==0 && (*x+1)>=0){//打印原点左边下方的点gotoxy((*y+*y-2),*x+1);printf("■");Arry_recordXY[i][j][0]=*x+1;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y-2;}else if(i==2 && j==1 && (*x+1)>=0){//打印原点下边的点gotoxy((*y+*y),*x+1);printf("■");Arry_recordXY[i][j][0]=*x+1;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y;}else if(i==2 && j==2 && (*x+1)>=0){//打印原点右边下方的点gotoxy((*y+*y)+2,*x+1);printf("■");Arry_recordXY[i][j][0]=*x+1;//记录要清除的点Arry_recordXY[i][j][1]=*y+*y+2;}}}}
}//函数名&功能:是否落地
//参数:x,y为坐标
//返回值:1为不落地,0为落地int isNotLandDown(char ary_Panel[][20],char ary_shapel[][3][3],int nType,int *x,int *y)
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){if(ary_shapel[nType][i][j]==Solid)//是否是实体{if(i==0 && j==0 ){//打印原点左边上方的点if(ary_Panel[*x-1+1][(*y-1)]==Wall || ary_Panel[*x-1+1][(*y-1)]==Landing){return 0;}}else if(i==0 && j==1 ){//打印原点上方的点if(ary_Panel[*x-1+1][(*y)]==Wall || ary_Panel[*x-1+1][(*y)]==Landing){return 0;}}else if(i==0 && j==2 ){//打印原点右边上方的点if(ary_Panel[*x-1+1][(*y+1)]==Wall || ary_Panel[*x-1+1][(*y+1)]==Landing){return 0;}}else if(i==1 && j==0 ){//打印原点左边的点if(ary_Panel[*x+1][(*y-1)]==Wall || ary_Panel[*x+1][(*y-1)]==Landing){return 0;}}else if(i==1 && j==1){if(ary_Panel[*x+1][(*y)]==Wall || ary_Panel[*x+1][(*y)]==Landing){return 0;}}else if(i==1 && j==2 ){//打印原点右边的点if(ary_Panel[*x+1][(*y+1)]==Wall || ary_Panel[*x+1][(*y+1)]==Landing){return 0;}}if(i==2 && j==0 ){//打印原点左边下方的点if(ary_Panel[*x+1+1][(*y-1)]==Wall || ary_Panel[*x+1+1][(*y-1)]==Landing){return 0;}}else if(i==2 && j==1 ){//打印原点下边的点if(ary_Panel[*x+1+1][*y]==Wall || ary_Panel[*x+1+1][*y]==Landing){return 0;}}else if(i==2 && j==2 ){//打印原点右边下方的点if(ary_Panel[*x+1+1][*y+1]==Wall || ary_Panel[*x+1+1][*y+1]==Landing){return 0;}}}}}return 1;
}//函数名&功能:设置落地的状态
//参数:
//返回值:voidvoid SetDownLandStatus(char ary_Panel[][20],char ary_shapel[][3][3],int nType,int x,int y)
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){if(ary_shapel[nType][i][j]==Solid)//是否是实体{if(i==0&&j==0){ary_Panel[x-1][y-1]=Landing;}else if(i==0&&j==1){ary_Panel[x-1][y]=Landing;}else if(i==0&&j==2){ary_Panel[x-1][y+1]=Landing;}else if(i==1&&j==0){ary_Panel[x][y-1]=Landing;}else if(i==1&&j==1){ary_Panel[x][y]=Landing;}else if(i==1&&j==2){ary_Panel[x][y+1]=Landing;}else if(i==2&&j==0){ary_Panel[x+1][y-1]=Landing;}else if(i==2&&j==1){ary_Panel[x+1][y]=Landing;}else if(i==2&&j==2){ary_Panel[x+1][y+1]=Landing;}}}}
}//函数名&功能:掉下
//参数:k为当前消除的行
//返回值:voidvoid DownRow(char ary_Panel[][20],int k)
{int i=0,j=0;for(k=k-1;k>=0;k--){for(j=1;j<19;j++){if(ary_Panel[k][j]==Landing){ary_Panel[k+1][j]=ary_Panel[k][j];ary_Panel[k][j]=Nop;}}}
}//函数名&功能:消除填满的行
//参数:
//返回值:1返回消行,0int  RemoveRow(char ary_Panel[][20],int x,int y)
{int i=0,j=0,isSolidRow=0;for(i=0;i<22;i++){for(j=1;j<19;j++){if(ary_Panel[i][j]==Nop)//是否满足消行?{isSolidRow=0;goto gotoNOP;}}for(j=1;j<19;j++){if(ary_Panel[i][j]==Landing)//是否满足消行?{isSolidRow=1;ary_Panel[i][j]=Nop;//消行;}}DownRow(ary_Panel,i);BrushsScreen(ary_Panel,x,y);//刷新屏gotoNOP:;}
}//函数名&功能:清记录的坐标
//参数:
//返回值:voidvoid Cls_Arry_recordXY(char Arry_recordXY[][3][2])
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){Arry_recordXY[i][j][0]=0x00;Arry_recordXY[i][j][1]=0x00;}}
}//函数名&功能:left是否发生碰撞
//参数:
//返回值:0发生碰撞int  isCollision_left(char ary_Panel[][20],char ary_shapel[][3][3] ,int x, int y,int nType)
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){if(ary_shapel[nType][i][j]==Solid)//是否是实体{if(i==0&&j==0){if(ary_Panel[x-1][y-1-1]==Landing || ary_Panel[x-1][y-1-1]==Wall){return 0;}}else if(i==0&&j==1){if(ary_Panel[x-1][y-1]==Landing || ary_Panel[x-1][y-1]==Wall){return 0;}}else if(i==0&&j==2){if(ary_Panel[x-1][y+1-1]==Landing || ary_Panel[x-1][y+1-1]==Wall){return 0;}}else if(i==1&&j==0){if(ary_Panel[x][y-1-1]==Landing || ary_Panel[x][y-1-1]==Wall){return 0;}}else if(i==1&&j==1){if(ary_Panel[x][y-1]==Landing || ary_Panel[x][y-1]==Wall){return 0;}}else if(i==1&&j==2){if(ary_Panel[x][y+1-1]==Landing || ary_Panel[x][y+1-1]==Wall){return 0;}}else if(i==2&&j==0){if(ary_Panel[x+1][y-1-1]==Landing || ary_Panel[x+1][y-1-1]==Wall){return 0;}}else if(i==2&&j==1){if(ary_Panel[x+1][y-1]==Landing || ary_Panel[x+1][y-1]==Wall){return 0;}}else if(i==2&&j==2){if(ary_Panel[x+1][y+1-1]==Landing || ary_Panel[x+1][y+1-1]==Wall){return 0;}}}}}return 1;
}//函数名&功能:翻转
//参数:
//返回值:void
//02=00	12=01
//22=02	21=12
//20=22	10=21
//00=20	01=10void Block_Turn(char ary_shapel[][3][3],int nType)
{char kk=0;int i=0,j=0,k=0;char cstr=0x00;cstr=ary_shapel[nType][0][2];ary_shapel[nType][0][2]=ary_shapel[nType][0][0];ary_shapel[nType][0][0]=ary_shapel[nType][2][0];ary_shapel[nType][2][0]=ary_shapel[nType][2][2];ary_shapel[nType][2][2]=cstr;cstr=ary_shapel[nType][1][2];ary_shapel[nType][1][2]=ary_shapel[nType][0][1];ary_shapel[nType][0][1]=ary_shapel[nType][1][0];ary_shapel[nType][1][0]=ary_shapel[nType][2][1];ary_shapel[nType][2][1]=cstr;
}//函数名&功能:key
//参数:
//返回值:voidchar key(int s)
{long t1, t2;char c;t1 = clock();dot2 = clock();while (((t2 - t1) < s) && !kbhit());if (kbhit()) {c = getch();} else {c = 0;}return c;
}//函数名&功能:是否能翻转
//参数:
//返回值:1能翻,0反之int isBlock_Turn(char ary_Panel[][20],char ary_shapel[][3][3],int nType,int x,int y)
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){if(i==0&&j==0){if(ary_Panel[x-1][y-1]==Landing||ary_Panel[x-1][y-1]==Wall){return 0;}}else if(i==0&&j==1){if(ary_Panel[x-1][y]==Landing||ary_Panel[x-1][y]==Wall){return 0;}}else if(i==0&&j==2){if(ary_Panel[x-1][y+1]==Landing||ary_Panel[x-1][y+1]==Wall){return 0;}}else if(i==1&&j==0){if(ary_Panel[x][y-1]==Landing||ary_Panel[x][y-1]==Wall){return 0;}}else if(i==1&&j==1){if(ary_Panel[x][y]==Landing||ary_Panel[x][y]==Wall){return 0;}}else if(i==1&&j==2){if(ary_Panel[x][y+1]==Landing||ary_Panel[x][y+1]==Wall){return 0;}}else if(i==2&&j==0){if(ary_Panel[x+1][y-1]==Landing||ary_Panel[x+1][y-1]==Wall){return 0;}}else if(i==2&&j==1){if(ary_Panel[x+1][y]==Landing||ary_Panel[x+1][y]==Wall){return 0;}}else if(i==2&&j==2){if(ary_Panel[x+1][y+1]==Landing||ary_Panel[x+1][y+1]==Wall){return 0;}}}}return 1;
}//函数名&功能:right是否发生碰撞
//参数:
//返回值:0发生碰撞int  isCollision_right(char ary_Panel[][20],char ary_shapel[][3][3] ,int x, int y,int nType)
{int i=0,j=0;for(i=0;i<3;i++){for(j=0;j<3;j++){if(ary_shapel[nType][i][j]==Solid)//是否是实体{if(i==0&&j==0){if(ary_Panel[x-1][y-1+1]==Landing || ary_Panel[x-1][y-1+1]==Wall){return 0;}}else if(i==0&&j==1){if(ary_Panel[x-1][y+1]==Landing || ary_Panel[x-1][y+1]==Wall){return 0;}}else if(i==0&&j==2){if(ary_Panel[x-1][y+1+1]==Landing || ary_Panel[x-1][y+1+1]==Wall){return 0;}}else if(i==1&&j==0){if(ary_Panel[x][y-1+1]==Landing || ary_Panel[x][y-1+1]==Wall){return 0;}}else if(i==1&&j==1){if(ary_Panel[x][y+1]==Landing || ary_Panel[x][y+1]==Wall){return 0;}}else if(i==1&&j==2){if(ary_Panel[x][y+1+1]==Landing || ary_Panel[x][y+1+1]==Wall){return 0;}}else if(i==2&&j==0){if(ary_Panel[x+1][y-1+1]==Landing || ary_Panel[x+1][y-1+1]==Wall){return 0;}}else if(i==2&&j==1){if(ary_Panel[x+1][y+1]==Landing || ary_Panel[x+1][y+1]==Wall){return 0;}}else if(i==2&&j==2){if(ary_Panel[x+1][y+1+1]==Landing || ary_Panel[x+1][y+1+1]==Wall){return 0;}}}}}return 1;
}//函数名&功能:游戏是否结束
//参数:
//返回值:1为结束,0反之int isGameOver(int x)
{if((x-1)<0){return 1;}return 0;
}//函数名&功能:游戏结束
//参数:
//返回值:1为结束,0反之void GameOver()
{system("cls");printf("Game over");
}//函数名&功能:暂停
//参数:
//返回值:void Stop()
{while(1){int chKey=0;chKey=key(200);if(chKey==0x20){break;}}
}//函数名&功能:可以下落的最大值
//参数:
//返回值:int maxDown(char ary_Panel[][20],char ary_shapel[][3][3],int nType,int x,int y)
{int x1=0;int i=0,j=0,k=0,z=0;while(1){if(ary_shapel[nType][2][0]==2){if(ary_Panel[x+1+1+x1][y-1]==0){i++;x1++;}else{break;}}else{break;}}x1=0;while(1){if(ary_shapel[nType][2][1]==2){if(ary_Panel[x+1+1+x1][y]==0){j++;x1++;}else{break;}}else{break;}}x1=0;while(1){if(ary_shapel[nType][2][2]==2){if(ary_Panel[x+1+1+x1][y+1]==0){k++;x1++;}else{break;}}else{break;}}z=i<=j?i:j;z=z<=k?z:k;return z;
}
#include<stdio.h>
#include"makehead.h"
#include<Windows.h>
#include<conio.h>int main()
{char ary_Panel[23][20]={0};char ary_shapel[ShapeType][3][3] = {//长条{{0, 2, 0},{0, 2, 0},{0, 2, 0}},//田字格{{2, 2, 2},{2, 2, 2},{2, 2, 2}},//L形{{0, 2, 0},{0, 2, 0},{0, 2, 2}},//L2形{{0, 2, 0},{0, 2, 0},{2, 2, 0}},//Z形{{0, 0, 0},{2, 2, 0},{0, 2, 2}},//Z2形{{0, 0, 0},{0, 2, 2},{2, 2, 0}},//T形{{2, 2, 2},{0, 2, 0},{0, 2, 0}},//小M形{{0, 0, 0},{2, 2, 2},{2, 0, 2}},//大M形{{2, 2, 2},{2, 0, 2},{2, 0, 2}},//大I形{{2, 3, 2},{2, 2, 2},{2, 0, 2}}};int i=0,j=0,chKey=0,nType=0;//初始化坐标int x=0,y=10;//方块的初始化坐标char Arry_recordXY[3][3][2]={0};
Gamestrat:i=Makepanel(ary_Panel) ;//显示主界面nType=initializationShape();//初始化方块的形状//nType=3;while(1){BrushsScreen2(Arry_recordXY);ShowShape(ary_shapel,nType,&x,&y,Arry_recordXY);//刷新显示方块边上的区域chKey=key(200);//if(_kbhit())if(chKey){//得到键盘输入//chKey= _getch() ;switch(chKey){case 'w'://翻转if(isBlock_Turn(ary_Panel,ary_shapel,nType,x,y)){Block_Turn(ary_shapel,nType);}break;case 's'://向下if(isNotLandDown(ary_Panel,ary_shapel,nType,&x,&y)){//x=x+maxDown(ary_Panel,ary_shapel,nType,x,y);x++;}break;case 'a'://向左if(isCollision_left(ary_Panel,ary_shapel,x,y,nType)){y--;}break;case 'd'://向右if(isCollision_right(ary_Panel,ary_shapel,x,y,nType)){y++;}break;case 0x20://暂停Stop();break;}chKey=0;}BrushsScreen2(Arry_recordXY);ShowShape(ary_shapel,nType,&x,&y,Arry_recordXY);//刷新显示方块边上的区域if(isNotLandDown(ary_Panel,ary_shapel,nType,&x,&y))//是否落地{x++;//方块自然下落Sleep(100);}else{if(isGameOver(x))//游戏是否失败{GameOver();goto gotoGameOver;}Cls_Arry_recordXY(Arry_recordXY);//清除记录的坐标SetDownLandStatus(ary_Panel,ary_shapel,nType,x,y);//设置落地的状态nType=initializationShape();//初始化方块的形状//nType=3;x=0;y=10;//方块的初始化坐标}RemoveRow(ary_Panel);//消除填满的行}
gotoGameOver:return 0;
}

转载于:https://www.cnblogs.com/baihelianzi/archive/2011/09/06/2169169.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/404918.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

放松时刻——C#分割字符串

让我们来练习一下字符串的分割~把话倒过来说&#xff1a; private void change_button_Click(object sender, EventArgs e) {var after_text before_TextBox.Text?.Select(x>x.ToString()).ToArray();string result "";for (int i after_text.Length - 1; i &…

使用WCF建立起Silverlight客户端与服务端的桥梁

最近正在开发一个项目&#xff0c;需要应用到Silverlight以及数据库。在正式开工之前需要掌握将数据从服务端送到客户端的技术&#xff0c;我们采用建立WCF服务的方法。 “做中学”是最好的学习方法&#xff0c;真正实践之后学习者将会有更多的自信和把握&#xff0c;这种感觉将…

如何用脚本可靠关闭一个linux服务或进程

一、脚本样例 以quectel的EC20模组关闭ppp拨号服务脚本为例&#xff0c;以下为脚本源码&#xff1a; #!/bin/sh timeout5 killall -15 pppd sleep 1 killall -0 pppd while [ $? -eq 0 ] dotimeoutexpr $timeout - 1if [ $timeout -eq 0 ]thenexit 1fisleep 1killall -0 ppp…

vscode 新建python 终端

ctrlshiftp 输入python&#xff0c; 选择Python:创建终端

STMF4x 固件库V1.25.0

https://www.st.com/en/embedded-software/stm32cubef4.html

初读CLR Via C# 之 IL、CTS、CLS

本章将对CLR中的IL、CTS和CLS进行一个大概的总结。下章将开始第二章的内容。 IL我们称之为高级汇编语言或者中间语言&#xff0c;在我们编写基于.NET框架下的程序&#xff08;不论是C#、VB或者J#等&#xff09;在被编译成本地CPU指令前&#xff0c;都将被编译成IL语言&#xff…

20231222给NanoPC-T4(RK3399)开发板的适配Android11的挖掘机方案并跑通AP6398SV

20231222给NanoPC-T4(RK3399)开发板的适配Android11的挖掘机方案并跑通AP6398SV 2023/12/22 7:54 简略步骤&#xff1a;rootrootrootroot-X99-Turbo:~/3TB$ cat Android11.0.tar.bz2.a* > Android11.0.tar.bz2 rootrootrootroot-X99-Turbo:~/3TB$ tar jxvf Android11.0.tar.…

KEIL5 编译器导致的程序异常

STM32F407写程序过程中发现了一个KEIL5 ARM编译器导致的BUG&#xff0c;记录如下。 源代码比较简单&#xff0c;分别打印两个标志量的值&#xff0c;采用了volatile 声明&#xff0c;避免被优化。 代码功能不用多说&#xff0c;看一下输出结果&#xff1a; 两个标志量都被编译…

STM32F407控制AD7606 采用HAL库的TIM和SPI

前言 本文介绍基于STM32F407的AD7606 8通道同步采集控制方式&#xff0c;总体思路&#xff1a;PWM驱动AD7606完成模数转换&#xff0c;AD7606转换完成后其BUSY引脚给出下降沿&#xff0c;STM32捕获外部中断并在中断服务程序中调用SPI串口读取AD7606数据&#xff0c;工程采用cu…

(转)二分图最大匹配的König定理及其证明

出处:http://www.matrix67.com/blog/archives/116 二分图最大匹配的Knig定理及其证明 如果你看不清楚第二个字母&#xff0c;下面有一个大号字体版本&#xff1a;二分图最大匹配的Knig定理及其证明 本文将是这一系列里最短的一篇&#xff0c;因为我只打算把Knig定理证了&…

如何使用struts2对集合参数进行验证

上一节介绍了struts2可以支持批量表单参数提交&#xff0c;那么提交到后台时如何利用strust2的validation框架对这个集合做验证&#xff1f; struts2提供了一个vistor校验器&#xff0c;可以实现这个需求 还是采用上一节中批量添加书籍的例子 1.jsp文件 <% taglib prefix&qu…

[Axure教程]0001.新手入门基础

Axure RP是一个专业的快速原型设计工具。Axure&#xff08;发音&#xff1a;Ack-sure&#xff09;&#xff0c;代表美国Axure公司&#xff1b;RP则是Rapid Prototyping&#xff08;快速原型&#xff09;的缩写。Axure RP已被一些大公司采用。Axure RP的使用者主要包括商业分析师…

【评论】GNU/Linux下有多少是GNU的?

导读&#xff1a;一个葡萄牙的学生写了一篇文章 《How much GNU is there in GNU/Linux?》由酷壳网的陈皓整理编译为《GNU/Linux下有多少是GNU的》。这篇文章主要分布了今年4月份的Ubuntu Natty的Linux分发包。其主要是用代码行来做的分析&#xff0c;用两个饼图对比分析。内容…

Linux下scp命令的用法

scp 对拷文件夹 和 文件夹下的所有文件 对拷文件并重命名 对拷文件夹 (包括文件夹本身) scp -r /home/wwwroot/www/charts/util root192.168.1.65:/home/wwwroot/limesurvey_back/scp 对拷文件夹下所有文件 (不包括文件夹本身) scp /home/wwwroot/www/charts/util/* root19…

研究者展示黑客通过GPU绕过防毒软件查杀的方法

Slashdot网站近日刊登了一篇研究文章称黑客可以通过特殊手段利用电脑中的GPU来躲避杀毒软件的清查。在这份PDF文档中&#xff0c;研究者展示了黑 客如何 利用GPU来躲避杀毒软件查杀的方法&#xff0c;作者还表示类似的技巧还有可能会发展升级为更加复杂的攻击手段&#xff0c;如…