当前位置: 首页 > news >正文

C#三人飞行棋

C#三人飞行棋

#region 1控制台设置int w = 50, h = 30;
ConsoleInit(w, h);
#endregion#region 2 场景选择实例//声明一个表示场景标识的变量
E_SceneType nowSceneType = new E_SceneType();
while (true)
{switch (nowSceneType){case E_SceneType.Begion://开始场景逻辑Console.Clear();BeginOrEndScene(w, h,ref nowSceneType);break;case E_SceneType.Game://游戏场景逻辑Console.Clear();GameScene(w, h,ref nowSceneType);break;case E_SceneType.End://结束场景逻辑Console.Clear();BeginOrEndScene(w, h, ref nowSceneType);break;default:break;}
}#endregion#region 1 控制台初始化
static void ConsoleInit(int w, int h)
{//基础设置//光标设置Console.CursorVisible = false;//舞台大小Console.SetWindowSize(w, h);Console.SetBufferSize(w, h);
}#endregion#region 3 开始场景逻辑static void BeginOrEndScene(int w, int h, ref E_SceneType nowSceneType)
{Console.ForegroundColor = ConsoleColor.White;Console.SetCursorPosition(nowSceneType == E_SceneType.Begion ? w / 2 - 3 : w / 2 - 4, 8);Console.Write(nowSceneType==E_SceneType.Begion ? "飞行棋" : "结束游戏");//默认开始游戏int nowSelIndex = 0;bool isQuitBegin = false;while (true){Console.SetCursorPosition(nowSceneType == E_SceneType.Begion ? w / 2 - 4 : w / 2 - 5, 13);Console.ForegroundColor = nowSelIndex == 0 ? ConsoleColor.Red : ConsoleColor.White;Console.Write(nowSceneType == E_SceneType.Begion ? "开始游戏" : "游戏主菜单");Console.ForegroundColor = nowSelIndex == 1 ? ConsoleColor.Red : ConsoleColor.White;Console.SetCursorPosition(w / 2 - 4, 15);Console.Write("退出游戏");//通过Readkey可以得到一个输入的枚举类型switch (Console.ReadKey(true).Key){case ConsoleKey.W:--nowSelIndex;if (nowSelIndex < 0){nowSelIndex = 1;}break;case ConsoleKey.S:++nowSelIndex;if (nowSelIndex > 1){nowSelIndex = 0;}break;case ConsoleKey.J:if (nowSelIndex == 0){nowSceneType = nowSceneType == E_SceneType.Begion ? E_SceneType.Game : E_SceneType.Begion;isQuitBegin = true;}else{Environment.Exit(0);}break;}if (isQuitBegin){break;}}
}
#endregion#region 4 游戏场景逻辑
static void GameScene(int w, int h,ref E_SceneType nowSceneType)
{DrawWall(w, h);//Grid grid = new Grid(5,5,E_Grid_Type.Boom);//grid.Draw();//绘制地图Map map = new Map(10,3,111);map.Draw();//绘制玩家Player player1 = new Player(0,E_Player_Type.Player1);Player player2 = new Player(0,E_Player_Type.Player2);Player computer =new Player(0,E_Player_Type.Computer);DrawPlayer(player1,player2,computer,map);bool isGameOver=false;while (true){Console.ReadKey(true);isGameOver = RandomMove(w,h,ref player1,ref player2,ref computer,map);map.Draw();DrawPlayer(player1, player2, computer, map);if (isGameOver){Console.ReadKey(true);nowSceneType = E_SceneType.End;break;}Console.ReadKey(true);isGameOver = RandomMove(w, h, ref player2, ref player1, ref computer, map);map.Draw();DrawPlayer(player1, player2, computer, map);if (isGameOver){Console.ReadKey(true);nowSceneType = E_SceneType.End;break;}Console.ReadKey(true);isGameOver = RandomMove(w, h, ref computer, ref player1, ref player2, map);map.Draw();DrawPlayer(player1, player2, computer, map);if (isGameOver){Console.ReadKey(true);nowSceneType = E_SceneType.End;break;}}
}#endregion#region 4 绘制不变内容(红墙 提示等)static void DrawWall(int w, int h)
{Console.ForegroundColor = ConsoleColor.Red;for (int i = 0; i < w; i += 2){Console.SetCursorPosition(i, 0);Console.Write("■");Console.SetCursorPosition(i, h - 1);Console.Write("■");Console.SetCursorPosition(i, h-6);Console.Write("■");Console.SetCursorPosition(i, h-11);Console.Write("■");}for (int i = 0; i < h; i++){Console.SetCursorPosition(0, i);Console.Write("■");Console.SetCursorPosition(w - 2, i);Console.Write("■");}//样式●■★◎ ▲ ◆ ⊙ ¤Console.ForegroundColor = ConsoleColor.White;Console.SetCursorPosition(2,h-10);Console.Write("□:普通格子");Console.ForegroundColor = ConsoleColor.Gray  ;Console.SetCursorPosition(22, h - 10);Console.Write("◆:玩家3");Console.ForegroundColor = ConsoleColor.Blue;Console.SetCursorPosition(2, h - 9);Console.Write("⊙:暂停,一回合不动");Console.ForegroundColor = ConsoleColor.DarkRed;Console.SetCursorPosition(26, h - 9);Console.Write("●:炸弹,倒退5格");Console.ForegroundColor = ConsoleColor.White;Console.SetCursorPosition(2, h - 8);Console.Write("¤:时空隧道,随机倒退,前进,暂停");Console.ForegroundColor = ConsoleColor.Cyan;Console.SetCursorPosition(2, h - 7);Console.Write("★:玩家");Console.ForegroundColor = ConsoleColor.Magenta;Console.SetCursorPosition(12, h - 7);Console.Write("▲:玩家2");///Console.ForegroundColor = ConsoleColor.Yellow;Console.SetCursorPosition(22, h - 7);Console.Write("◎:玩家和电脑重合");Console.ForegroundColor = ConsoleColor.White;Console.SetCursorPosition(2, h - 5);Console.Write("按任意键开始扔骰子");}#endregion#region 8 扔骰子 函数
static void ClearInfo(int w,int h)
{Console.SetCursorPosition(2, h - 5);Console.Write("                                        ");Console.SetCursorPosition(2, h - 4);Console.Write("                                        ");Console.SetCursorPosition(2, h - 3);Console.Write("                                        ");Console.SetCursorPosition(2, h - 2);Console.Write("                                        ");
}
static bool RandomMove(int w, int h, ref Player p, ref Player p2,ref Player c, Map map)
{ClearInfo(w,h);if (p.type == E_Player_Type.Player1){Console.ForegroundColor = ConsoleColor.Cyan;}else if (p.type == E_Player_Type.Player2){Console.ForegroundColor = ConsoleColor.Magenta;}else{Console.ForegroundColor = ConsoleColor.Gray;}if (p.isPause){Console.SetCursorPosition(2,h-5);if (p.type == E_Player_Type.Player1){Console.Write("玩家1处于暂停点,玩家1需要暂停一回合");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2处于暂停点,玩家2需要暂停一回合");}else{Console.Write("玩家3处于暂停点,玩家3需要暂停一回合");}p.isPause = false;return false;}Random r = new Random();int randomNum = r.Next(1, 7);p.nowIndex += randomNum;Console.SetCursorPosition(2,h-5);if (p.type == E_Player_Type.Player1){Console.Write("玩家1扔出的点数为:"+randomNum);}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2扔出的点数为:"+randomNum);}else{Console.Write("玩家3扔出的点数为:" + randomNum);}if (p.nowIndex >= map.grids.Length - 1){p.nowIndex = map.grids.Length - 1;Console.SetCursorPosition(2, h - 4);if (p.type == E_Player_Type.Player1){Console.Write("玩家1获胜");Console.SetCursorPosition(2, h - 3);Console.Write("按任意键结束游戏");return true;}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2获胜");Console.SetCursorPosition(2, h - 3);Console.Write("按任意键结束游戏");return true;}else{Console.Write("玩家3获胜");Console.SetCursorPosition(2, h - 3);Console.Write("按任意键结束游戏");return true;}return true;}else{Grid grid = map.grids[p.nowIndex];switch (grid.type){case E_Grid_Type.Normal:Console.SetCursorPosition(2,h-4);if (p.type == E_Player_Type.Player1){Console.Write("玩家1处于安全位置");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2处于安全位置");}else{Console.Write("玩家3处于安全位置");}Console.SetCursorPosition(2, h - 3);if (p.type == E_Player_Type.Player1){Console.Write("请按任意键,玩家2开始仍骰子");}else if (p.type == E_Player_Type.Player2){Console.Write("请按任意键,玩家3开始仍骰子");}else{Console.Write("请按任意键,玩家1开始仍骰子");}break;case E_Grid_Type.Boom://炸弹退格p.nowIndex -= 5;if (p.nowIndex < 0){p.nowIndex = 0;}Console.SetCursorPosition(2, h - 4);if (p.type == E_Player_Type.Player1){Console.Write("玩家1踩到了炸弹,退后5格");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2踩到了炸弹,退后5格");}else{Console.Write("玩家3踩到了炸弹,退后5格");}Console.SetCursorPosition(2, h - 3);if (p.type == E_Player_Type.Player1){Console.Write("请按任意键,玩家2开始仍骰子");}else if (p.type == E_Player_Type.Player2){Console.Write("请按任意键,玩家3开始仍骰子");}else{Console.Write("请按任意键,玩家1开始仍骰子");}break;case E_Grid_Type.Pause://暂停一回合p.isPause = true;Console.SetCursorPosition(2, h - 4);if (p.type == E_Player_Type.Player1){Console.Write("玩家1暂停一回合");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2暂停一回合");}else{Console.Write("玩家3暂停一回合");}Console.SetCursorPosition(2, h - 3);if (p.type == E_Player_Type.Player1){Console.Write("请按任意键,玩家2开始仍骰子");}else if (p.type == E_Player_Type.Player2){Console.Write("请按任意键,玩家3开始仍骰子");}else{Console.Write("请按任意键,玩家1开始仍骰子");}break;case E_Grid_Type.Tunnel:Console.SetCursorPosition(2, h - 4);if (p.type == E_Player_Type.Player1){Console.Write("玩家1进入了时空隧道");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2进入了时空隧道");}else{Console.Write("玩家3进入了时空隧道");}//随机randomNum = r.Next(1,91);if (randomNum<30){p.nowIndex -= 5;if(p.nowIndex < 0){p.nowIndex = 0;}Console.SetCursorPosition(2, h - 3);if (p.type == E_Player_Type.Player1){Console.Write("玩家1退5格");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2退5格");}else{Console.Write("玩家3退5格");}}else if (randomNum <= 60){p.isPause = true;Console.SetCursorPosition(2, h - 3);if (p.type == E_Player_Type.Player1){Console.Write("玩家1暂停一回合");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2暂停一回合");}else{Console.Write("玩家3暂停一回合");}}else{p.nowIndex += 3;if(p.nowIndex >= map.grids.Length - 1){p.nowIndex = map.grids.Length - 2;}Console.SetCursorPosition(2, h - 3);if (p.type == E_Player_Type.Player1){Console.Write("玩家1前进格3格");}else if (p.type == E_Player_Type.Player2){Console.Write("玩家2前进格3格");}else{Console.Write("玩家3前进格3格");}}Console.SetCursorPosition(2, h - 2);if (p.type == E_Player_Type.Player1){Console.Write("请按任意键,玩家2开始仍骰子");}else if (p.type == E_Player_Type.Player2){Console.Write("请按任意键,玩家3开始仍骰子");}else{Console.Write("请按任意键,玩家1开始仍骰子");}break;default:break;}}return false;
}#endregion#region 7 绘制玩家
static void DrawPlayer(Player player1,Player player2,Player computer,Map map)
{if (player1.nowIndex == computer.nowIndex && player1.nowIndex == player2.nowIndex && player2.nowIndex == computer.nowIndex){Grid grid = map.grids[player2.nowIndex];Console.ForegroundColor = ConsoleColor.Yellow;Console.SetCursorPosition(grid.pos.x, grid.pos.y);Console.Write("◎");}else if (player1.nowIndex == computer.nowIndex){Grid grid = map.grids[player1.nowIndex];Console.ForegroundColor = ConsoleColor.Yellow;Console.SetCursorPosition(grid.pos.x, grid.pos.y);Console.Write("◎");player2.Draw(map);}else if (player1.nowIndex == player2.nowIndex){Grid grid = map.grids[player1.nowIndex];Console.ForegroundColor = ConsoleColor.Yellow;Console.SetCursorPosition(grid.pos.x, grid.pos.y);Console.Write("◎");computer.Draw(map);}else if (player2.nowIndex == computer.nowIndex){Grid grid = map.grids[player2.nowIndex];Console.ForegroundColor = ConsoleColor.Yellow;Console.SetCursorPosition(grid.pos.x, grid.pos.y);Console.Write("◎");player1.Draw(map);}else{player1.Draw(map);player2.Draw(map);computer.Draw(map);}
}
#endregion#region 2 场景选择设置
/// <summary>
/// 游戏场景枚举类型
/// </summary>
enum E_SceneType
{/// <summary>/// 开始场景/// </summary>Begion,/// <summary>/// 游戏场景/// </summary>Game,/// <summary>/// 结束场景/// </summary>End,
}
#endregion#region 5 格子结构体和格子枚举
/// <summary>
/// 格子类型 枚举
/// </summary>
enum E_Grid_Type
{/// <summary>/// 普通格子/// </summary>Normal,/// <summary>/// 炸弹/// </summary>Boom,/// <summary>/// 暂停/// </summary>Pause,/// <summary>/// 时空隧道/// </summary>Tunnel,
}struct Vector2
{public int x;public int y;public Vector2(int x, int y){this.x = x; this.y = y;}
}
struct Grid
{//格子类型public E_Grid_Type type;//格子位置public Vector2 pos;//初始化构造函数public Grid(int x,int y,E_Grid_Type type){pos.x = x; pos.y = y;this.type = type;}public void Draw(){Console.SetCursorPosition(pos.x, pos.y);switch (type){case E_Grid_Type.Normal:Console.ForegroundColor= ConsoleColor.White;Console.Write("□");break;case E_Grid_Type.Boom:Console.ForegroundColor = ConsoleColor.DarkRed;Console.Write("●");break;case E_Grid_Type.Pause:Console.ForegroundColor = ConsoleColor.Blue;Console.Write("⊙");break;case E_Grid_Type.Tunnel:Console.ForegroundColor = ConsoleColor.White;Console.Write("¤");break;default:break;}}
}#endregion#region 6 地图结构体struct Map
{public Grid[] grids;public Map(int x,int y,int num){grids = new Grid[num];//用于位置改变计数的变量int indexX = 0, indexY = 0, stepNum = 2;    //x的步长Random random = new Random();int randomNum;for (int i = 0; i < num; i++){randomNum = random.Next(0, 101);if (randomNum < 85 || i == 0 || i == num - 1){grids[i].type = E_Grid_Type.Normal;}else if (randomNum>=85 && randomNum<90){grids[i].type = E_Grid_Type.Boom;}else if (randomNum >=90 && randomNum<95){grids[i].type = E_Grid_Type.Pause;}else{grids[i].type = E_Grid_Type.Tunnel;}grids[i].pos = new Vector2(x, y);if (indexX ==14){y += 1;++indexY;if (indexY ==2){indexX = 0;indexY = 0;stepNum = -stepNum; //反向步长}}else{x += stepNum;++indexX;}}}public void Draw(){for (int i = 0; i < grids.Length; i++){grids[i].Draw();}}
}#endregion#region 7 玩家枚举和玩家结构体
enum E_Player_Type
{/// <summary>/// 玩家1/// </summary>Player1,/// <summary>/// 玩家2/// </summary>Player2,/// <summary>/// 电脑/// </summary>Computer,
}struct Player
{public E_Player_Type type;public int nowIndex;public bool isPause; public Player(int index,E_Player_Type type){nowIndex = index;this.type = type;isPause = false;}public void Draw(Map mapInfo){Grid grid = mapInfo.grids[nowIndex];Console.SetCursorPosition(grid.pos.x, grid.pos.y);switch (type){case E_Player_Type.Player1:Console.ForegroundColor = ConsoleColor.Cyan;Console.Write("★");break;case E_Player_Type.Player2:Console.ForegroundColor = ConsoleColor.Magenta;Console.Write("▲");break;case E_Player_Type.Computer:Console.ForegroundColor = ConsoleColor.Gray;Console.Write("◆");break;default:break;}}
}
#endregion

相关文章:

C#三人飞行棋

C#三人飞行棋 #region 1控制台设置int w 50, h 30; ConsoleInit(w, h); #endregion#region 2 场景选择实例//声明一个表示场景标识的变量 E_SceneType nowSceneType new E_SceneType(); while (true) {switch (nowSceneType){case E_SceneType.Begion://开始场景逻辑Consol…...

Notes for the missing semester. Useful and basic knowledge about Linux.

The Shell Contents The first course is to introduce some simple commands. I’ll list some commands that I’m not familiar with: # --silent means dont give log info, # --head means we only want the http head. curl --head --silent bing.com.cn# cut --deli…...

【信息系统项目管理师知识点速记】资源管理基础

项目团队 执行项目工作,实现项目目标的一组人员。成员具备不同技能,可全职或兼职,随项目进展而变化。参与项目规划和决策,贡献专业技能,增强对项目的责任感。项目管理团队 直接参与项目管理活动的成员,负责项目管理和领导。负责项目各阶段的启动、规划、执行、监督、控制…...

Android性能优化面试题汇总

Android的性能优化涉及多个方面,如启动优化、稳定性优化、内存优化、网络优化、电量优化、安全优化等方面。 一、稳定性优化 1.1 你们做了哪些稳定性方面的优化 随着项目的逐渐成熟,用户基数逐渐增多,DAU持续升高,我们遇到了很多稳定性方面的问题,对于我们技术同学遇到…...

Ansible 自动化运维工具 - 了解和模块应用

目录 一. Ansible 的相关知识 1.1 Ansible 工具的简介 1.2 Ansible的四大组件 1.3 运维自动化工具 1.4 Ansible 和其它自动化运维工具对比 1.5 Ansible 的优缺点 二. Ansible 环境安装部署 2.1 管理端安装 ansible 2.2 配置主机清单 三. ansible 命令行模块 3.1 comm…...

AI神助攻!小白也能制作自动重命名工具~

我们平时从网上下载一些文件&#xff0c;文件名很多都是一大串字母和数字&#xff0c;不打开看看&#xff0c;根本不知道里面是什么内容。 我想能不能做个工具&#xff0c;把我们一个文件夹下面的所有word、excel、ppt、pdf文件重命名为文件内容的第一行。 我们有些朋友可能不会…...

(读书笔记-大模型) LLM Powered Autonomous Agents

目录 智能体系统的概念 规划组件 记忆组件 工具组件 案例研究 智能体系统的概念 在大语言模型&#xff08;LLM&#xff09;赋能的自主智能体系统中&#xff0c;LLM 充当了智能体的大脑&#xff0c;其三个关键组件分别如下&#xff1a; 首先是规划&#xff0c;它又分为以下…...

超分辨率重建——BSRN网络训练自己数据集并推理测试(详细图文教程)

目录 一、BSRN网络总结二、源码包准备三、环境准备3.1 报错KeyError: "No object named BSRN found in arch registry!"3.2 安装basicsr源码包3.3 参考环境 四、数据集准备五、训练5.1 配置文件参数修改5.2 启动训练5.2.1 命令方式训练5.2.2 配置Configuration方式训…...

C语言实现贪吃蛇

目录 前言一 . 游戏背景1. 背景介绍2. 项目目标3. 技术要点 二 . 效果演示三 . 游戏的设计与分析1. 核心逻辑2. 设计与分析游戏开始Gamestart()函数游戏运行Gamerun()函数游戏结束Gameend()函数 四 . 参考代码五 . 总结 前言 本文旨在使用C语言和基础数据结构链表来实现贪吃蛇…...

高可用系列四:loadbalancer 负载均衡

负载均衡可以单独使用&#xff0c;也常常与注册中心结合起来使用&#xff0c;其需要解决的问题是流量分发&#xff0c;这是就需要定义分发策略&#xff0c;当然也包括了故障切换的能力。 故障切换 故障切换是负载均衡的基本能力&#xff0c;和注册中心结合时比较简单&#xf…...

Ruby递归目录文件的又一种方法

经常派得上用场&#xff0c;记录一下。 递归文件做一些操作 #encoding:utf-8require pathnamedef recursive_enum_files(from_path)from_path Pathname.new(from_path)raise ArgumentError,must start at a directory. unless from_path.directory?from_path.enum_for(:fin…...

【爬虫】爬取A股数据写入数据库(一)

1. 对东方财富官网的分析 步骤&#xff1a; 通过刷新网页&#xff0c;点击等操作&#xff0c;我们发现https://datacenter-web.eastmoney.com/api/data/v1/get?请求后面带着一些参数即可以获取到相应数据。我们使用python来模拟这个请求即可。 我们以如下选择的页面为切入点…...

1-38 流资源类结构

一 简介 1. Java中所说的流资源--IO流 2.为什么学习留资源&#xff1f; --要操作文件中的数据 将数据写入指定的文件 将数据从指定的文件读取 3.分类 -- 四大基流 , 八大子流 (重点) 按照流向分 : 输入流 和输出流 按照操作数据资源的类型划分 字符流 (重点) Reader -- 字符…...

nginx的前世今生(二)

书接上回&#xff1a; 上回书说到&#xff0c;nginx的前世今生&#xff0c;这回我们继续说 3.缓冲秘籍&#xff0c;洪流控水 Nginx的缓冲区是其处理数据传输和提高性能的关键设计之一&#xff0c;主要用于暂存和管理进出的数据流&#xff0c;以应对不同组件间速度不匹配的问题…...

浏览器跨域详解

一、什么是跨域 浏览器跨域是指当一个Web应用程序试图访问另一个协议、主机或端口不同的资源时&#xff0c;所发生的情况。这主要是由于浏览器的同源策略造成的&#xff0c;它是为了网站的安全而设置的安全限制&#xff0c;防止一个网站恶意访问另一个网站的资源。当然这是比较…...

华为5700配置

恢复出厂设置&#xff0c;清空配置 1、更改名字 system-view sysname tp-10-50-01-04 2、配置管理接口 int vlan 1 ip add 10.50.1.4 255.255.254.0 quit 2、链路汇聚 interface eth-trunk 1 mode lacp quit 3、绑定端口 interface eth-trunk 1 trunkport gigabitethernet …...

使用Axios从前端上传文件并且下载后端返回的文件

前端代码&#xff1a; function uploadAndDownload(){showLoading();const fileInput document.querySelector(#uploadFile);const file fileInput.files[0];const formData new FormData()formData.append(file, file)return new Promise((resolve, reject) > {axios({…...

open 函数到底做了什么

使用设备之前我们通常都需要调用 open 函数&#xff0c;这个函数一般用于设备专有数据的初始化&#xff0c;申请相关资源及进行设备的初始化等工作&#xff0c;对于简单的设备而言&#xff0c;open 函数可以不做具体的工作&#xff0c;你在应用层通过系统调用 open 打开设备…...

ue引擎游戏开发笔记(32)——为游戏添加新武器装备

1.需求分析&#xff1a; 游戏中角色不会只有一种武器&#xff0c;不同武器需要不同模型&#xff0c;甚至可能需要角色持握武器的不同位置&#xff0c;因此需要添加专门的武器类&#xff0c;方便武器后续更新&#xff0c;建立一个武器类。 2.操作实现&#xff1a; 1.在ue5中新建…...

【个人博客搭建】(17)使用FluentValidation 参数校验

FluentValidation 是一个用于 .NET 的开源验证库&#xff0c;它提供了一种流畅的接口和强类型验证规则&#xff0c;使得验证逻辑表达得更加清晰和简洁。&#xff08;Apache-2.0&#xff09; FluentValidation 的主要作用包括&#xff1a; 提高代码可读性&#xff1a;通过使用 F…...

业务系统对接大模型的基础方案:架构设计与关键步骤

业务系统对接大模型&#xff1a;架构设计与关键步骤 在当今数字化转型的浪潮中&#xff0c;大语言模型&#xff08;LLM&#xff09;已成为企业提升业务效率和创新能力的关键技术之一。将大模型集成到业务系统中&#xff0c;不仅可以优化用户体验&#xff0c;还能为业务决策提供…...

MongoDB学习和应用(高效的非关系型数据库)

一丶 MongoDB简介 对于社交类软件的功能&#xff0c;我们需要对它的功能特点进行分析&#xff1a; 数据量会随着用户数增大而增大读多写少价值较低非好友看不到其动态信息地理位置的查询… 针对以上特点进行分析各大存储工具&#xff1a; mysql&#xff1a;关系型数据库&am…...

Android Bitmap治理全解析:从加载优化到泄漏防控的全生命周期管理

引言 Bitmap&#xff08;位图&#xff09;是Android应用内存占用的“头号杀手”。一张1080P&#xff08;1920x1080&#xff09;的图片以ARGB_8888格式加载时&#xff0c;内存占用高达8MB&#xff08;192010804字节&#xff09;。据统计&#xff0c;超过60%的应用OOM崩溃与Bitm…...

docker 部署发现spring.profiles.active 问题

报错&#xff1a; org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property spring.profiles.active imported from location class path resource [application-test.yml] is invalid in a profile specific resource [origin: class path re…...

【数据分析】R版IntelliGenes用于生物标志物发现的可解释机器学习

禁止商业或二改转载&#xff0c;仅供自学使用&#xff0c;侵权必究&#xff0c;如需截取部分内容请后台联系作者! 文章目录 介绍流程步骤1. 输入数据2. 特征选择3. 模型训练4. I-Genes 评分计算5. 输出结果 IntelliGenesR 安装包1. 特征选择2. 模型训练和评估3. I-Genes 评分计…...

STM32HAL库USART源代码解析及应用

STM32HAL库USART源代码解析 前言STM32CubeIDE配置串口USART和UART的选择使用模式参数设置GPIO配置DMA配置中断配置硬件流控制使能生成代码解析和使用方法串口初始化__UART_HandleTypeDef结构体浅析HAL库代码实际使用方法使用轮询方式发送使用轮询方式接收使用中断方式发送使用中…...

MyBatis中关于缓存的理解

MyBatis缓存 MyBatis系统当中默认定义两级缓存&#xff1a;一级缓存、二级缓存 默认情况下&#xff0c;只有一级缓存开启&#xff08;sqlSession级别的缓存&#xff09;二级缓存需要手动开启配置&#xff0c;需要局域namespace级别的缓存 一级缓存&#xff08;本地缓存&#…...

热烈祝贺埃文科技正式加入可信数据空间发展联盟

2025年4月29日&#xff0c;在福州举办的第八届数字中国建设峰会“可信数据空间分论坛”上&#xff0c;可信数据空间发展联盟正式宣告成立。国家数据局党组书记、局长刘烈宏出席并致辞&#xff0c;强调该联盟是推进全国一体化数据市场建设的关键抓手。 郑州埃文科技有限公司&am…...

Neko虚拟浏览器远程协作方案:Docker+内网穿透技术部署实践

前言&#xff1a;本文将向开发者介绍一款创新性协作工具——Neko虚拟浏览器。在数字化协作场景中&#xff0c;跨地域的团队常需面对实时共享屏幕、协同编辑文档等需求。通过本指南&#xff0c;你将掌握在Ubuntu系统中使用容器化技术部署该工具的具体方案&#xff0c;并结合内网…...

FTXUI::Dom 模块

DOM 模块定义了分层的 FTXUI::Element 树&#xff0c;可用于构建复杂的终端界面&#xff0c;支持响应终端尺寸变化。 namespace ftxui {...// 定义文档 定义布局盒子 Element document vbox({// 设置文本 设置加粗 设置文本颜色text("The window") | bold | color(…...