黑客帝国数字雨C语言代码
#include <windows.h> #define ID_TIMER 1 #define STRMAXLEN 25 //一个显示列的最大长度 #define STRMINLEN 8
#include<windows.h> #defineID_TIMER1 #defineSTRMAXLEN25// 一个显示列的最大长度 #defineSTRMINLEN8// 一个显示列的最小长度 LRESULTCALLBACKWndProc(HWND,UINT,WPARAM,LPARAM); ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// typedefstructtagCharChain//, 整个当作屏幕的一个显示列这是个双向列表 { structtagCharChain*prev;// 链表的前个元素 TCHARch;// 一个显示列中的一个字符 structtagCharChain*next;// 链表的后个元素 }CharChain,*pCharChain; typedefstructtagCharColumn { CharChain*head,*current,*point; intx,y,iStrLen;//x,y,iStrLen 显示列的开始显示的坐标是这个列的长度 intiStopTimes,iMustStopTimes;//, 已经停滞的次数和必须停滞的次数必须停滞的 次数是随机的 }CharColumn,*pCharColumn; intmain(HINSTANCEhInstance,HINSTANCEhPrevInstance,PSTRszCmdLine,int iCmdShow) { staticTCHARszAppName[]=TEXT("matrix"); HWNDhwnd; MSGmsg; WNDCLASSwndclass; wndclass.style=CS_HREDRAW|CS_VREDRAW; wndclass.lpfnWndProc=WndProc; wndclass.cbClsExtra=0; wndclass.cbWndExtra=0; wndclass.hInstance=hInstance; wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION); wndclass.hCursor=LoadCursor(NULL,IDC_ARROW); wndclass.hbrBackground=(HBRUSH)GetStockObject(BLACK_BRUSH); wndclass.lpszMenuName=NULL; wndclass.lpszClassName=szAppName; if(!RegisterClass(&wndclass))

