当前位置: 首页 > 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…...

Vim 调用外部命令学习笔记

Vim 外部命令集成完全指南 文章目录 Vim 外部命令集成完全指南核心概念理解命令语法解析语法对比 常用外部命令详解文本排序与去重文本筛选与搜索高级 grep 搜索技巧文本替换与编辑字符处理高级文本处理编程语言处理其他实用命令 范围操作示例指定行范围处理复合命令示例 实用技…...

Xshell远程连接Kali(默认 | 私钥)Note版

前言:xshell远程连接&#xff0c;私钥连接和常规默认连接 任务一 开启ssh服务 service ssh status //查看ssh服务状态 service ssh start //开启ssh服务 update-rc.d ssh enable //开启自启动ssh服务 任务二 修改配置文件 vi /etc/ssh/ssh_config //第一…...

电脑插入多块移动硬盘后经常出现卡顿和蓝屏

当电脑在插入多块移动硬盘后频繁出现卡顿和蓝屏问题时&#xff0c;可能涉及硬件资源冲突、驱动兼容性、供电不足或系统设置等多方面原因。以下是逐步排查和解决方案&#xff1a; 1. 检查电源供电问题 问题原因&#xff1a;多块移动硬盘同时运行可能导致USB接口供电不足&#x…...

Psychopy音频的使用

Psychopy音频的使用 本文主要解决以下问题&#xff1a; 指定音频引擎与设备&#xff1b;播放音频文件 本文所使用的环境&#xff1a; Python3.10 numpy2.2.6 psychopy2025.1.1 psychtoolbox3.0.19.14 一、音频配置 Psychopy文档链接为Sound - for audio playback — Psy…...

CMake控制VS2022项目文件分组

我们可以通过 CMake 控制源文件的组织结构,使它们在 VS 解决方案资源管理器中以“组”(Filter)的形式进行分类展示。 🎯 目标 通过 CMake 脚本将 .cpp、.h 等源文件分组显示在 Visual Studio 2022 的解决方案资源管理器中。 ✅ 支持的方法汇总(共4种) 方法描述是否推荐…...

DeepSeek 技术赋能无人农场协同作业:用 AI 重构农田管理 “神经网”

目录 一、引言二、DeepSeek 技术大揭秘2.1 核心架构解析2.2 关键技术剖析 三、智能农业无人农场协同作业现状3.1 发展现状概述3.2 协同作业模式介绍 四、DeepSeek 的 “农场奇妙游”4.1 数据处理与分析4.2 作物生长监测与预测4.3 病虫害防治4.4 农机协同作业调度 五、实际案例大…...

基于Java+MySQL实现(GUI)客户管理系统

客户资料管理系统的设计与实现 第一章 需求分析 1.1 需求总体介绍 本项目为了方便维护客户信息为了方便维护客户信息&#xff0c;对客户进行统一管理&#xff0c;可以把所有客户信息录入系统&#xff0c;进行维护和统计功能。可通过文件的方式保存相关录入数据&#xff0c;对…...

Go 语言并发编程基础:无缓冲与有缓冲通道

在上一章节中&#xff0c;我们了解了 Channel 的基本用法。本章将重点分析 Go 中通道的两种类型 —— 无缓冲通道与有缓冲通道&#xff0c;它们在并发编程中各具特点和应用场景。 一、通道的基本分类 类型定义形式特点无缓冲通道make(chan T)发送和接收都必须准备好&#xff0…...

JavaScript基础-API 和 Web API

在学习JavaScript的过程中&#xff0c;理解API&#xff08;应用程序接口&#xff09;和Web API的概念及其应用是非常重要的。这些工具极大地扩展了JavaScript的功能&#xff0c;使得开发者能够创建出功能丰富、交互性强的Web应用程序。本文将深入探讨JavaScript中的API与Web AP…...

【JavaSE】多线程基础学习笔记

多线程基础 -线程相关概念 程序&#xff08;Program&#xff09; 是为完成特定任务、用某种语言编写的一组指令的集合简单的说:就是我们写的代码 进程 进程是指运行中的程序&#xff0c;比如我们使用QQ&#xff0c;就启动了一个进程&#xff0c;操作系统就会为该进程分配内存…...