- 博客(86)
- 资源 (4)
- 收藏
- 关注
原创 文字游戏2.0
这段代码实现了一个基于控制台的文字游戏,包含两个关卡。游戏特点包括:1. 使用汉字作为游戏元素(鸟、河、树等);2. 实现了玩家移动和敌人追踪逻辑;3. 包含特殊元素触发事件(如进入洞穴触发彩虹猫彩蛋);4. 支持关卡选择和基本的游戏状态判断(死亡/通关)。代码存在一些潜在问题:1. 递归调用可能引发栈溢出;2. 部分变量命名不规范;3. 功能重复的关卡设计;4. 缺少必要的错误处理。建议优化代码结构,增加注释,并修复潜在bug。
2025-08-10 13:49:38
16
原创 小镇游戏C佳佳
#include<iostream>#include<windows.h>#include<conio.h>#include<unistd.h>#include<cstdlib>#include<time.h>#include<cmath> #include<fstream>#include<bits/stdc++.h>#include<cstdio>#include.
2022-06-29 11:37:04
2512
2
原创 C++输出爱心
💗#include<stdio.h>#include<Windows.h>int main() { float x, y, a; for (y = 1.5; y > -1.5; y -= 0.1) { for (x = -1.5; x < 1.5; x += 0.05) { a = x * x + y * y - 1; putchar(a * a * a - x * x * y * y * y <= 0.0 ? '*' : ' '
2022-05-29 17:36:38
1344
原创 C++一步解决cls闪烁问题
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);//定义显示器句柄变量,并且这个只能在每个头文件中单独定义句柄和函数,否则无效 void gotoxy(HANDLE hOut, int x, int y)//其中x,y是与正常理解相反的,注意区分 { COORD pos; pos.X = x; //横坐标 pos.Y = y; //纵坐标 ...
2022-04-18 21:43:35
1778
原创 运行错误哪位大什帮我一下C++
GetCurrentConsoleFont(hOutput, FALSE, &consoleCurrentFont);
2022-04-09 20:15:03
729
原创 抄写的C++常用函数
void ycgb()//隐藏光标 { CONSOLE_CURSOR_INFO cursor; cursor.bVisible = FALSE; cursor.dwSize = sizeof(cursor); HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorInfo(handle, &cursor); return; } void ydgb(long long h, long long .
2022-04-08 18:16:47
733
原创 设置字体及大小C++
void SetFont(int size = 30) {//hello imX2G CONSOLE_FONT_INFOEX cfi; //hello imX2G cfi.cbSize = sizeof cfi; //hello imX2G cfi.nFont = 0; //hello imX2G cfi.dwFontSize.X = 0; //hello imX2G cfi.dwFontSize.Y = size; //设置字体大小 cfi.FontFamily = FF_DONTCARE.
2022-03-19 21:32:50
5375
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人