# 黑客帝国 **Repository Path**: TYY890/the_matrix_of_hackers ## Basic Information - **Project Name**: 黑客帝国 - **Description**: 第一次实验 - **Primary Language**: C - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-05-22 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #include #include #include #include #define High 20 #define Width 30 int moveDirection; int canvas[High][Width]={10}; void gotoxy(int x,int y) { HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); COORD pos; pos.X=x; pos.Y=y; SetConsoleCursorPosition(handle,pos); } void moveSnakeByDirection() { int i,j; for(i=1;i0) canvas[i][j]++; int oldTail_i,oldTail_j,oldHead_i,oldHead_j; int max=0; for(i=1;i0) { if(max1) printf("*"); } printf("\n"); } sleep(100); } void updateWithoutInput() { moveSnakeByDirection(); } void updateWithInput() { } int main() { startup(); while(1) { show(); updateWithoutInput(); updateWithInput(); } return 0; }