[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
Game instructions :
W key The plane moved up
S key The plane moved down
A key The plane moved to the left
D key The plane moved to the right
Space bar The plane fired shells
#include <stdio.h> #include <stdlib.h> #include <conio.h>
// General input output library , Mainly the input and output of files and standard console #include <windows.h>// Contains the Sleep() Functions, etc void
hide_cursor(void){ CONSOLE_CURSOR_INFO info={1,0}; SetConsoleCursorInfo(
GetStdHandle(STD_OUTPUT_HANDLE),&info); } int main(void){ int x=5; int y=10; int
i,j; int is_fire=0;// Launch or not int nx=y/2;// Target position int is_killed=0;// Was it killed srand(time(
NULL));// Generating random number seeds hide_cursor();// hide cursor system("mode con cols=60 lines=40");
// Set screen to phone format while(1){ system("cls"); if(is_killed==0){// They didn't get killed , Draw the target for(i=0;i<nx;
i++) printf(" "); printf("@\n"); } if(is_fire==0){ for(i=0;i<y;i++) printf("\n")
; }else{ for(i=0;i<y;i++){ for(j=0;j<x;j++) printf(" "); printf(" |\n"); is_fire
=0; } if(nx==x+2) is_killed=1; } // Drawing airplanes for(i=0;i<x;i++) printf(" "); printf("
*\n"); for(i=0;i<x;i++) printf(" "); printf("*****\n"); for(i=0;i<x;i++) printf(
" "); printf(" * *\n"); if( kbhit() ){ // If a keyboard key is detected , return 1 int c= getch();
// Get keyboard value , There is no need to press enter switch(c){ case 'a':x--;break; case 'd':x++;break; case 's':y++;
break; case 'w':y--;break; case ' ':is_fire=1;break; } } Sleep(200); // retention 200 millisecond
Output with pause } }