diff --git a/practices/c/level0/c1panduanshu.c b/practices/c/level0/c1panduanshu.c new file mode 100644 index 00000000..995794b2 --- /dev/null +++ b/practices/c/level0/c1panduanshu.c @@ -0,0 +1,23 @@ +# include + +int main() +{ + int input; + scanf("%d",&input); + + if(input>0){ + if(input%2==0){ + printf("是正数而且是偶数\n"); + } + else { + printf("是正数但不是偶数\n"); + } + } + else if(input==0){ + printf("既不是正数也不是负数\n"); + } + else{ + printf("是负数\n"); + } + return 0; +} diff --git a/practices/c/level0/helloworld.c b/practices/c/level0/helloworld.c new file mode 100644 index 00000000..f9a33167 --- /dev/null +++ b/practices/c/level0/helloworld.c @@ -0,0 +1,8 @@ +# include + +int main() +{ + printf("Hello World! I'm 李帅锋!\n"); + + return 0; +} diff --git a/practices/c/level1/p01_runningLetter/RunningLetter.c b/practices/c/level1/p01_runningLetter/RunningLetter.c new file mode 100644 index 00000000..d3c4dec9 --- /dev/null +++ b/practices/c/level1/p01_runningLetter/RunningLetter.c @@ -0,0 +1,26 @@ +# include +# include + +int main() +{ + int i,j; + for(i=0;i<12;i++){ + for(j=0;j0;i--){ + for(j=0;j + +int main() +{ + int i,x = 0; + int infox=-1; + scanf("%d",&x); + + for( i=2;i + +int main(void) +{ + // age/6+age/12+age/7+5 = age-age/2-4 + for(int i=10;i<=120;i++){ + if(i%6 == 0 && i%12 == 0 && i%7 == 0){ + printf("His age is %d",i); + } + } + + return 0; + } diff --git a/practices/c/level1/p04_ narcissus/narcissus.c b/practices/c/level1/p04_ narcissus/narcissus.c new file mode 100644 index 00000000..8ad291e0 --- /dev/null +++ b/practices/c/level1/p04_ narcissus/narcissus.c @@ -0,0 +1,23 @@ +#include +# include + +int main(void) +{ + int shuixianshu; + int baiwei,shiwei,gewei; + + printf("三位水仙数如下:\n"); + + for(int i = 100;i<1000;i++){ + baiwei = i/100; + shiwei = (i%100)/10; + gewei = i%10; + + if(i==pow(baiwei,3)+pow(shiwei,3)+pow(gewei,3)){ + shuixianshu = i; + printf("%d\t",shuixianshu); + } + } + + return 0; + } diff --git a/practices/c/level1/p05_allPrimes/allPrimers.c b/practices/c/level1/p05_allPrimes/allPrimers.c new file mode 100644 index 00000000..2af8fa95 --- /dev/null +++ b/practices/c/level1/p05_allPrimes/allPrimers.c @@ -0,0 +1,44 @@ +#include +#include + +int isPrimer(int num); + +int main() +{ + clock_t start,finish; + start = clock(); + int primer; + + + for(int i = 2;i<=1000;i++){ + primer = isPrimer(i); + if(primer){ + printf("%d\n",i); + } + } + + printf("the running time is:\t"); + finish = clock(); + double time = (double)(finish-start)*1000/CLOCKS_PER_SEC; + printf("%lf ms",time); + + return 0; + } + + int isPrimer(int num){ + int result = 0; + int cnt = 0; + + for(int i = 2;i<=sqrt(num);i++){ + if(num%i==0) { + cnt++; + break; + } + } + + if(cnt==0){ + result = 1; + } + + return result; + } diff --git a/practices/c/level1/p06_Goldbach/Goldbach.c b/practices/c/level1/p06_Goldbach/Goldbach.c new file mode 100644 index 00000000..8f1be60c --- /dev/null +++ b/practices/c/level1/p06_Goldbach/Goldbach.c @@ -0,0 +1,52 @@ +#include +#include + +int isPrimer(int num); + +int main() +{ + int primer[25]; + int cnt = 0; + for(int i = 2;i<100;i++){ + if(isPrimer(i)) { + primer[cnt] = i; + cnt++; + } + } + + for(int i=3;i<=100;i++){ + if(i%2==0){ + for(int m = 0;m<=25;m++){ + for(int n = 0;n<=25;n++){ + if(primer[m]+primer[n]==i){ + printf("%d=%d+%d\n",i,primer[m],primer[n]); + } + } + } + } + } + + printf("So,we can learn that Goldbach's suspect is right in 0-100.\n"); + return 0; + } + + int isPrimer(int num){ + int result = 0; + int cnt = 0; + + for(int i = 2;i<=sqrt(num);i++){ + if(num%i==0) { + cnt++; + break; + } + } + + if(cnt==0){ + result = 1; + } + + return result; + } + + + diff --git a/practices/c/level1/p07_encrypt_decrypt/encrypt_decrypt.c b/practices/c/level1/p07_encrypt_decrypt/encrypt_decrypt.c new file mode 100644 index 00000000..7270d1fa --- /dev/null +++ b/practices/c/level1/p07_encrypt_decrypt/encrypt_decrypt.c @@ -0,0 +1,26 @@ +#include +#include +char s[50000]; +void encrypt(); +void decrypt(); +int main() +{ + scanf("%s", s); + encrypt(); + printf("%s\n", s); + decrypt(); + printf("%s\n", s); + return 0; +} +void encrypt() +{ + int i; + for (i = 0; i < strlen(s); i++) + s[i] += 5; +} +void decrypt() +{ + int i; + for (i = 0; i < strlen(s); i++) + s[i] -= 5; +} diff --git a/practices/c/level1/p08_hanoi/hanoi.c b/practices/c/level1/p08_hanoi/hanoi.c new file mode 100644 index 00000000..100684da --- /dev/null +++ b/practices/c/level1/p08_hanoi/hanoi.c @@ -0,0 +1,28 @@ +# include + +int i= 0; + +int main() +{ + int N; + printf("input positive integer N: "); + scanf("%d",&N); + + move('a','b','c',N); + + printf("these are all steps!"); + return 0; + } + + void move(char str1,char str2,char str3,int n) + { + if(n==1){ + printf("the %dst step:\t",++i); + printf("%c->%c\n",str1,str3); + }else{ + move(str1,str3,str2,n-1); + printf("the %dst step:\t",++i); + printf("%c->%c\n",str1,str3); + move(str2,str1,str3,n-1); + } + } diff --git a/practices/c/level1/p09_maze/maze.c b/practices/c/level1/p09_maze/maze.c new file mode 100644 index 00000000..26706193 --- /dev/null +++ b/practices/c/level1/p09_maze/maze.c @@ -0,0 +1,110 @@ +# include +# include +#include +# define SIZE 10 + +int maze[SIZE][SIZE] = { + 1,1,1,1,1,1,1,1,1,1, + 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, + 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, + 1,0,0,1,0,1,1,1,0,1, + 1,1,0,1,0,1,0,0,1,1, + 1,0,0,1,0,0,0,1,0,1, + 1,1,0,0,1,1,1,0,0,1, + 1,1,1,0,0,0,1,1,0,1, + 1,0,0,0,1,0,0,0,0,1, + 1,1,1,1,1,1,1,1,1,1 + +}; + +void begin() +{ + printf("this is a small maze game\n"); + printf("please enter any key to continue..."); + getchar(); + system("cls"); + for (int i = 0; i < 40; i++) { + printf("Maze generation..."); + system("cls"); + } +} + +void show_maze(int prex,int prey,char c,int cnt) +{ + system("cls"); + int i, j; + + for ( i = 0; i < SIZE; i++) { + for ( j = 0; j < SIZE; j++) { + if (maze[i][j]==1) printf("%c%c", 0xa8, 0x80); + else if (i == prey&&j == prex) printf("**"); + else printf(" "); + if (j == SIZE - 1) printf("\n"); + } + } + if (cnt) { + printf("You can't head to a wall!!\n"); + } +} + +int ifhead(int *nowx, int *nowy,char c) +{ + if (maze[*nowy][*nowx] == 1) { + + switch (c) + { + case 72: + *nowy += 1; + break; + case 75: + *nowx += 1; + break; + case 80: + *nowy -= 1; + break; + case 77: + *nowx -= 1; + break; + } + return 1; + } + return 0; +} + +int main() +{ + int k = 0, cnt = 0; + int nowx = 1, nowy = 1; + begin(); + show_maze(1,1,0,cnt); + + while (1) { + char c = _getch(); + + switch (c) + { + case 72: + nowy -= 1; + break; + case 75: + nowx -= 1; + break; + case 80: + nowy += 1; + break; + case 77: + nowx += 1; + break; + } + cnt = ifhead(&nowx, &nowy, c); + show_maze(nowx, nowy, c,cnt); + + if (nowx == SIZE - 2 && nowy == SIZE - 2) { + printf("Congratulations,You have passed this game!\n"); + break; + } + } + + system("pause"); + return 0; +} diff --git a/practices/c/level1/p10_pushBoxes/PushBoxs.c b/practices/c/level1/p10_pushBoxes/PushBoxs.c new file mode 100644 index 00000000..24539247 --- /dev/null +++ b/practices/c/level1/p10_pushBoxes/PushBoxs.c @@ -0,0 +1,155 @@ +# include +# include +#include +# define SIZE 8 + +int cnt; +int MAP[SIZE][SIZE] = { + { 0,0,1,1,1,0,0,0 }, + { 0,0,1,4,1,0,0,0 }, + { 0,0,1,2,1,1,1,1 }, + { 1,1,1,0,0,2,4,1 }, + { 1,4,0,2,3,1,1,1 }, + { 1,1,1,1,2,1,0,0 }, + { 0,0,0,1,4,1,0,0 }, + { 0,0,0,1,1,1,0,0 } +}; + +int init() +{ + printf("This is a small push boxes game,\nPlease enter any key to continue...\n"); + for (int i = 0; i < 30; i++) { + printf("please waiting for a second...\n"); + system("cls"); + } +} +int show_map() +{ + system("cls"); + int i, j; + for ( i = 0; i < SIZE ; i++) { + for (j = 0; j < SIZE ; j++) { + switch (MAP[i][j]) + { + case 0: + printf(" "); + break; + case 1: + printf("%c%c", 0xa8, 0x80); //代表墙壁 + break; + case 2: + printf("□"); //代表箱子 + break; + case 3: + printf("⊙"); //代表自己 + break; + case 4: + printf("☆"); //代表将要推往的地点 + break; + case 5: + printf("★"); //代表已经推到的箱子 + break; + case 6: + printf("◆"); //表示人和地点是在一个地方 + break; + } + if (j == SIZE - 1) printf("\n"); + } + } +} + +int mod_map(int *nowx,int *nowy,int *lastx,int *lasty) +{ + if (MAP[*nowy][*nowx] == 2) { + //如果下下一位是空地 + if (MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] == 0) { + MAP[*nowy][*nowx] = 3; + MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] = 2; + MAP[*lasty][*lastx] = 0; + } + //如果下下一个是目的地 + else if (MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] == 4) { + MAP[*nowy][*nowx] = 3; + MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] = 5; + MAP[*lasty][*lastx] = 0; cnt++; + } + //如果下下一个是墙 + else if (MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] == 1) { + *nowx = *lastx; *nowy = *lasty; + } + } + else if(MAP[*nowy][*nowx] == 0){ //如果什么都没有,就换位 + MAP[*nowy][*nowx] = 3; + MAP[*lasty][*lastx] = 0; + } + //如果是撞到墙了,修改nowx,nowy的值 + else if (MAP[*nowy][*nowx] == 1) { + *nowx = *lastx; + *nowy = *lasty; + } + //如果下一个位置是目的地 + else if (MAP[*nowy][*nowx] == 4) { + MAP[*nowy][*nowx] = 6; + MAP[*lasty][*lastx] = 0; + } + //如果下一个地方是已经到达目的地的箱子 + else if (MAP[*nowy][*nowx] == 5) { + //如果箱子的下一个位置是空地 + if (MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] == 0) { + MAP[*nowy][*nowx] = 6; + MAP[*lasty][*lastx] = 0; + MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] = 2; + cnt--; + } + //如果下下一个是目的地 + else if (MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] == 4) { + MAP[*nowy][*nowx] = 6; + MAP[*lasty][*lastx] = 0; + MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] = 5; + } + //如果下下一个是墙 + else if (MAP[*nowy + *nowy - *lasty][*nowx + *nowx - *lastx] == 1) { + *nowx = *lastx; + *nowy = *lasty; + } + } + + show_map(); + return; +} + +int main() +{ + init(); + show_map(); + + int nowx=4, nowy=4; + int lastx, lasty; + while (1) { + lastx = nowx, lasty = nowy; + char c = _getch(); + + switch (c) + { + case 72: + nowy -= 1; + break; + case 75: + nowx -= 1; + break; + case 80: + nowy += 1; + break; + case 77: + nowx += 1; + break; + } + mod_map(&nowx, &nowy, &lastx, &lasty); + if (cnt == 4) break; + } + printf("Congratulations!You win!"); + + system("pause"); + + return 0; +} diff --git a/practices/c/level1/p11_linkedList/linklist.c b/practices/c/level1/p11_linkedList/linklist.c new file mode 100644 index 00000000..eed62a90 --- /dev/null +++ b/practices/c/level1/p11_linkedList/linklist.c @@ -0,0 +1,141 @@ +# include +# include + +struct LinkNode { + int data; + struct LinkNode *pNext; +}; +typedef struct LinkNode node; + +node*init(node*phead) +{ + phead = NULL; +} + +node*add_back(node*phead, int newdata) +{ + node*pnew = (node*)malloc(sizeof(node)); + pnew->data = newdata; + pnew->pNext = NULL; + if (phead == NULL) { + phead = pnew; + } + else { + node*ptemp = phead; + + while (ptemp->pNext != NULL) + { + ptemp = ptemp->pNext; + } + ptemp->pNext = pnew; + } + return phead; +} + +void showall(node *phead) +{ + if (phead == NULL) { + return; + } + else { + printf("%d\t%p\t%p\n", phead->data, phead, phead->pNext); + showall(phead->pNext); + } +} + +node* revit(node*phead) +{ + if (phead == NULL || phead->pNext == NULL) { + return; + } + else { + node*pre = NULL; + node*pcur = NULL; + node*pnext = NULL; + + pre = phead; //pre指向第1个节点 + pcur = phead->pNext; //pcur指向第二个节点 + while (pcur!=NULL) + { + pnext = pcur->pNext; //备份下一个节点 + pcur->pNext = pre; //反转 + + //前进 + pre = pcur; + pcur = pnext; + //pnext = pnext->pNext; 在前面已经提到 + } + phead->pNext = NULL; + phead = pre; + } + return phead; +} +int finddata(node*phead, int finddata) +{ + int findnum=0; + node*ptemp = phead; + while (ptemp != NULL) + { + findnum++; + if (ptemp->data == finddata) { + return findnum; + } + ptemp = ptemp->pNext; + + } + return -1; +} + +int findsecdata(node*phead, int finddata) +{ + int findnum = 0; + int cnt = 0; + node*ptemp = phead; + while (ptemp != NULL) + { + findnum++; + if (ptemp->data == finddata) { + cnt++; + if(cnt==2){ + return findnum; + } + ptemp = ptemp->pNext; + continue; + } + ptemp = ptemp->pNext; + + } + return -1; +} + +int main() +{ + int number = 0; + printf("input the number of the data\n"); + scanf("%d", &number); + node*phead=NULL; + init(phead); + + int newdata = 0; + for (int i = 0; i < number; i++) { + printf("please input the %dth number:", i); + scanf("%d", &newdata); + phead = add_back(phead, newdata); + } + + showall(phead); + + phead = revit(phead); + printf("反转之后输出:\n"); + + showall(phead); + printf("\nplease input the data that you want to found:"); + int findnum = 0; + scanf("%d", &findnum); + + printf("\n第一个数据所在的节点是:%d\n", finddata(phead, findnum)); + + printf("\n第二个数据所在的节点是:%d\n", findsecdata(phead, findnum)); + system("pause"); + return 0; +} diff --git a/practices/cpp/level1/p01_Queue/Queue.cpp b/practices/cpp/level1/p01_Queue/Queue.cpp new file mode 100644 index 00000000..9d87dc2f --- /dev/null +++ b/practices/cpp/level1/p01_Queue/Queue.cpp @@ -0,0 +1,87 @@ +# include +using namespace std; + +class Queue { +private: + int data[100]; + int poptrail; + int apptrail; + int *p; +public: + Queue(); + void append(int num); + void pop(); + bool IsFull(); + bool IsEmpty(); + void showall(); + ~Queue(); +}; + +Queue::Queue() +{ + memset(data, 0, 100); + poptrail = 0; + apptrail = 0; + p = data; +} +void Queue::append(int num) +{ + data[apptrail] = num; + apptrail++; +} +void Queue::pop() +{ + p++; + poptrail++; +} +bool Queue::IsFull() +{ + if (apptrail == 100) { + return true; + } + return false; +} +bool Queue:: IsEmpty() +{ + if(poptrail==100||apptrail==0){ + return true; + } +return false; +} + +void Queue::showall() +{ + int poptra = poptrail; + for (int i = poptra; i < 100;i++ ) { + cout << data[poptra] << endl; + poptra++; + } +} +Queue::~Queue() +{ + +} + + +int main() +{ + int i = 1; + Queue queue; + if (queue.IsEmpty()) { + for (i = 1; i <= 100; i++) { + queue.append(i); + } + } + if (queue.IsFull()) { + queue.showall(); + cout << endl; + } + for (i = 1; i <= 100; i++) { + queue.pop(); + if (queue.IsEmpty()) { + cout << "the queue pop successfully" << endl; + } + } + system("pause"); + return 0; +} diff --git a/practices/cpp/level1/p03_SafeArray/SafeArry.cpp b/practices/cpp/level1/p03_SafeArray/SafeArry.cpp new file mode 100644 index 00000000..07faf73c --- /dev/null +++ b/practices/cpp/level1/p03_SafeArray/SafeArry.cpp @@ -0,0 +1,64 @@ +# include +# include +# include +using namespace std; + +class SafeArry { +private: + int array[300]; +public: + SafeArry(); + ~SafeArry(); + void put(int vrl); + bool get(int num); +}; + +SafeArry::SafeArry() +{ + memset(array, 0, 300); +} +void SafeArry::put(int vrl) +{ + for (int i = 0; i < 300; i++) { + array[i] = vrl; + } +} +bool SafeArry::get(int num) +{ + if (num - 1 > 299||num<1) { + cout << "ilegal visit!!" << endl; + cout << "please input again:"<> num; + while (1) { + if (safearry.get(num)) { + break; + } + else { + cin >> num; + } + } + + system("pause"); + return 0; +} diff --git a/practices/cpp/level1/p05_Canvas/Canvas.cpp b/practices/cpp/level1/p05_Canvas/Canvas.cpp new file mode 100644 index 00000000..a4181a7f --- /dev/null +++ b/practices/cpp/level1/p05_Canvas/Canvas.cpp @@ -0,0 +1,159 @@ +# include +using namespace std; +int Nc, Nr; + +class Point { +private: + int X, Y; +public: + Point(int x = 0, int y = 0) + { + X = x; + Y = y; + } + int GetX() + { + return X; + } + int GetY() + { + return Y; + } + void SetPoint(int x, int y) + { + X = x; + Y = y; + } +}; + +class Circle { +private: + int R; + Point Circl; +public: + Circle(int r=0, Point circl = 0) + { + R = r; + Circl = Circl; + } + void show() + { + cout << "The radius r = " << R << endl; + cout << "The circlepoint is:" << "(" << Circl.GetX() << "," << Circl.GetY() << ")" << endl; + } + void SetCircle(int r, Point c) + { + R = r; + Circl = c; + } +}; + +class Rect { +private: + Point Left; + Point Right; +public: + Rect(Point left=0, Point right= 0) + { + Left = left; + Right = right; + } + void show() + { + cout << "The left point Left = " << "(" << Left.GetX() << "," << Left.GetY() << ")" << endl; + cout << "The right point Right = " << "(" << Right.GetX() << "," << Right.GetY() << ")" << endl; + } + void SetRect(Point left, Point right) + { + Left = left; + Right = right; + } +}; + +class Canvas { +private: + Circle *pc = new Circle[Nc]; + Rect *pr = new Rect[Nr]; + int iC; + int iR; +public: + void addCir(Circle c) + { + pc[iC] = c; + iC++; + } + void addRec(Rect r) + { + pr[iR] = r; + iR++; + } + void showall() + { + cout << "The circles you have saved are below:" << endl; + for (int i = 0; i < iC; i++) { + pc[i].show(); + } + cout<< "The rectangles you have saved are below:" << endl; + for (int i = 0; i < iR; i++) { + pr[i].show(); + } + } + ~Canvas() + { + delete[] pc; + delete[] pr; + } +}; + +int main() +{ + cout << "How many circles do you want to save?" << endl; + cin >> Nc; + cout << "How many rectangles do you want to save?" << endl; + cin >> Nr; + Point P1; + Point P2; + Circle C; + Rect R; + Canvas Ca; + int r = 0, xc = 0, yc = 0; + for (int i = 0; i < Nc; i++) { + cout << "Please input the " << i + 1 << "th circle:" << endl; + cout << "r = "; + cin >> r; + cout << "Please input its circlepoint :" << endl; + cout << "x = "; + cin >> xc; + cout << "y = "; + cin >> yc; + + P1.SetPoint(xc, yc); + C.SetCircle(r, P1); + Ca.addCir(C); + } + int leftx = 0, lefty = 0; + int rightx = 0, righty = 0; + for (int i = 0; i < Nr; i++) { + cout << "Please input the " << i + 1 << "th rectangle:" << endl; + cout << "The left lower point :" << endl; + cout << "x = "; + cin >> leftx; + cout << "y = "; + cin >> lefty; + cout << "The left lower point :" << endl; + cout << "x = "; + cin >> rightx; + cout<< "y = "; + cin >> righty; + + P1.SetPoint(leftx, lefty); + P2.SetPoint(rightx, righty); + R.SetRect(P1, P2); + Ca.addRec(R); + } + cout << endl; + Ca.showall(); + system("pause"); + return 0; +} + diff --git a/practices/cpp/level1/p06_CircleAndPoint/CircleAndPoint.cpp b/practices/cpp/level1/p06_CircleAndPoint/CircleAndPoint.cpp new file mode 100644 index 00000000..93d39a70 --- /dev/null +++ b/practices/cpp/level1/p06_CircleAndPoint/CircleAndPoint.cpp @@ -0,0 +1,72 @@ +# include +using namespace std; + +class Point { +private: + int x,y; +public: + Point(int sx=0, int sy=0) + { + x = sx; + y = sy; + } + int GetX() + { + return x; + } + int GetY() + { + return y; + } + void SetPoint(int setx,int sety) + { + x = setx; + y = sety; + } +}; + +class Circle { +private: + Point now; + + int R; +public: + Circle(int r , Point nw) { + R = r; + now = nw; + } + void show() + { + cout << "x = " << now.GetX() << "\t" << "y = " << now.GetY() << endl; + cout << "R = " << R << endl; + } + Circle move(int movex,int movey) + { + int NextX, NextY; + NextX = now.GetX() + movex; + NextY = now.GetY() + movey; + Point temp; + temp.SetPoint(NextX, NextY); + Circle Temp(R, temp); + return Temp; + } + +}; +int main() +{ + Point P1(3, 5); + Point P2(0, 0); + Circle C1(3, P1); + C1.show(); + Circle C2 = C1.move(1, 2); + cout << "after " << 1 << " move :" << endl; + C2.show(); + for (int i = 0; i < 9; i++) { + C2 = C2.move(1, 2); + cout << "after " << i + 2 << " move :" << endl; + C2.show(); + } + + system("pause"); + return 0; +} diff --git a/practices/cpp/level1/p11_Fighters/README.md b/practices/cpp/level1/p11_Fighters/README.md index 58761a68..2c92d72f 100755 --- a/practices/cpp/level1/p11_Fighters/README.md +++ b/practices/cpp/level1/p11_Fighters/README.md @@ -2,4 +2,7 @@ ### 功能要求: -随心所欲!!! \ No newline at end of file +随心所欲!!! + +代码详见VScode库 +https://github.com/Flsahkong/Vscode diff --git a/practices/cpp/level1/p11_Fighters/READMEFIRST.md b/practices/cpp/level1/p11_Fighters/READMEFIRST.md new file mode 100644 index 00000000..e6075ae0 --- /dev/null +++ b/practices/cpp/level1/p11_Fighters/READMEFIRST.md @@ -0,0 +1,4 @@ +所有的代码已经转移 + +详见VScode库 +https://github.com/Flsahkong/Vscode diff --git a/practices/cpp/level1/p11_Fighters/TodoList.md b/practices/cpp/level1/p11_Fighters/TodoList.md index 497725f5..82e3f1e9 100755 --- a/practices/cpp/level1/p11_Fighters/TodoList.md +++ b/practices/cpp/level1/p11_Fighters/TodoList.md @@ -1,25 +1,32 @@ | 任务(功能) | Value | Effort | 是否已完成 -----|-------------------------------|-----------|-----------|------------| -1 | 完成SFML配置,显示“SFML works” | 0 | | | -2 | 显示一架静止的飞机于屏幕底部 | 5 | | | -3 | 背景音乐 | 1 | | | -4 | 左右键,控制移动飞机 | 10 | | | -5 | 限制左右边界 | 1 | | | -6 | 空格键开炮,显示运动的炮弹 | 5 | | | -7 | 炮弹飞出边界处理 | 2 | | | -8 | 随机产生敌机,并向下运动 | 10 | | | -9 | 敌机飞出边界处理 | 2 | | | -10 | 碰撞处理(敌机与炮弹碰撞) | 10 | | | -11 | 显示敌机爆炸过程 | 10 | | | -12 | 爆炸声音 | 2 | | | -13 | 计分及显示 | 5 | | | -14 | 敌机炮弹处理 | 10 | | | -15 | 被敌机击中处理(炸毁、3条命) | 10 | | | -16 | 过关控制(过关需要计分、游戏速度控制)| 20 | | | +1   | 完成SFML配置,显示“SFML works” | 0         |           |  是         | +2   | 显示一架静止的飞机于屏幕底部       | 5         |           |   是        | +3   | 背景音乐                       | 1         |           |     是      | +4   | 左右键,控制移动飞机             | 10       |           |  是         | +5   | 限制左右边界                   | 1         |           |   是        | +6 | 空格键开炮,显示运动的炮弹 | 5 | | 是 | +7 | 炮弹飞出边界处理 | 2 | | 是 | +8   | 随机产生敌机,并向下运动         | 10       |           |   是              | +9   | 敌机飞出边界处理               | 2         |           |      是     | +10   | 碰撞处理(敌机与炮弹碰撞)       | 10         |           |     是      | +11   | 显示敌机爆炸过程               | 10         |           |    是       | +12   | 爆炸声音                       | 2         |           |     是      | +13   | 计分及显示                     | 5         |           |     是      | +14   | 敌机炮弹处理                   | 10         |           |     是      | +15   | 被敌机击中处理(炸毁、3条命)     | 10         |           |    是       | +16   | 过关控制(过关需要计分、游戏速度控制)| 20       |           |    是       | 17 | | | | | 18 | | | | | 19 | | | | | -20 | | | | | -合计 | | | | | +20   |上下左右键控制飞机移动            |  5         |           |   是      | +21   |两种Boss,Boss耐子弹的能力不同    | 20        |           |   是       | +22    |Boss的子弹随机往各个方向移动       |15          |           |  是      | +23   | 给飞机设置三种技能                | 20        |            |  是        | +24   | 点击F11关闭所有声音               | 5         |             |  是      | +25   | 游戏开始动画,游戏玩法说明         |   10      |            |  是      | +26    |游戏结束后,可以选择退出或者重新开始| 15        |           |  是      | + +合计   |                                 |  193      |           |    是       |