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

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…...

iOS 26 携众系统重磅更新,但“苹果智能”仍与国行无缘

美国西海岸的夏天&#xff0c;再次被苹果点燃。一年一度的全球开发者大会 WWDC25 如期而至&#xff0c;这不仅是开发者的盛宴&#xff0c;更是全球数亿苹果用户翘首以盼的科技春晚。今年&#xff0c;苹果依旧为我们带来了全家桶式的系统更新&#xff0c;包括 iOS 26、iPadOS 26…...

三维GIS开发cesium智慧地铁教程(5)Cesium相机控制

一、环境搭建 <script src"../cesium1.99/Build/Cesium/Cesium.js"></script> <link rel"stylesheet" href"../cesium1.99/Build/Cesium/Widgets/widgets.css"> 关键配置点&#xff1a; 路径验证&#xff1a;确保相对路径.…...

java调用dll出现unsatisfiedLinkError以及JNA和JNI的区别

UnsatisfiedLinkError 在对接硬件设备中&#xff0c;我们会遇到使用 java 调用 dll文件 的情况&#xff0c;此时大概率出现UnsatisfiedLinkError链接错误&#xff0c;原因可能有如下几种 类名错误包名错误方法名参数错误使用 JNI 协议调用&#xff0c;结果 dll 未实现 JNI 协…...

大模型多显卡多服务器并行计算方法与实践指南

一、分布式训练概述 大规模语言模型的训练通常需要分布式计算技术,以解决单机资源不足的问题。分布式训练主要分为两种模式: 数据并行:将数据分片到不同设备,每个设备拥有完整的模型副本 模型并行:将模型分割到不同设备,每个设备处理部分模型计算 现代大模型训练通常结合…...

以光量子为例,详解量子获取方式

光量子技术获取量子比特可在室温下进行。该方式有望通过与名为硅光子学&#xff08;silicon photonics&#xff09;的光波导&#xff08;optical waveguide&#xff09;芯片制造技术和光纤等光通信技术相结合来实现量子计算机。量子力学中&#xff0c;光既是波又是粒子。光子本…...

LLMs 系列实操科普(1)

写在前面&#xff1a; 本期内容我们继续 Andrej Karpathy 的《How I use LLMs》讲座内容&#xff0c;原视频时长 ~130 分钟&#xff0c;以实操演示主流的一些 LLMs 的使用&#xff0c;由于涉及到实操&#xff0c;实际上并不适合以文字整理&#xff0c;但还是决定尽量整理一份笔…...

搭建DNS域名解析服务器(正向解析资源文件)

正向解析资源文件 1&#xff09;准备工作 服务端及客户端都关闭安全软件 [rootlocalhost ~]# systemctl stop firewalld [rootlocalhost ~]# setenforce 0 2&#xff09;服务端安装软件&#xff1a;bind 1.配置yum源 [rootlocalhost ~]# cat /etc/yum.repos.d/base.repo [Base…...

python爬虫——气象数据爬取

一、导入库与全局配置 python 运行 import json import datetime import time import requests from sqlalchemy import create_engine import csv import pandas as pd作用&#xff1a; 引入数据解析、网络请求、时间处理、数据库操作等所需库。requests&#xff1a;发送 …...

Linux部署私有文件管理系统MinIO

最近需要用到一个文件管理服务&#xff0c;但是又不想花钱&#xff0c;所以就想着自己搭建一个&#xff0c;刚好我们用的一个开源框架已经集成了MinIO&#xff0c;所以就选了这个 我这边对文件服务性能要求不是太高&#xff0c;单机版就可以 安装非常简单&#xff0c;几个命令就…...