C/C++实现老鼠走迷宫
老鼠形象可以辨认,可以用上下左右操纵老鼠;正确检测结果,若老鼠在规定的时间内走到粮仓,提示成功,否则提示失败。代码分为3个文件:main.cpp、play.h、play.cpp。
main.cpp:
#include <iostream>
#include <windows.h>
#include "play.h"
#include <stdio.h>
using namespace std;
/* run this program using the console pauser or add your own _getch, system("pause") or input loop */
int main()
{
int Count = 0;
cout << "欢迎使用自制迷宫游戏,Are you ready?";
Sleep(500);
cout << ".";
Sleep(500);
cout << ".";
Sleep(500);
cout << ".";
// system("cls");
// cout<<"\t\t*************************************************"<<endl;
// cout<<"\t\t* *"<<endl;
// cout<<"\t\t* 1.开始游戏 *"<<endl;
// cout<<"\t\t* *"<<endl;
// cout<<"\t\t* 2.编辑游戏 *"<<endl;
// cout<<"\t\t* *"<<endl;
// cout<<"\t\t* 3.退出游戏 *"<<endl;
// cout<<"\t\t* *"<<endl;
// cout<<"\t\t*************************************************"<<endl;
Player play_1(11, 11);
Player play_2(13, 13);
Player play_3(15, 15);
int Menu;
while (1)
{
if (Count < 1)
{
system("cls");
cout << "\t\t*************************************************" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 1.开始游戏 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 2.编辑游戏 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 3.查看最短路径与所有路径 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 4.退出游戏 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t*************************************************" << endl;
}
else if (Count >= 1)
{
system("cls");
cout << "\t\t*************************************************" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 1.开始游戏 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 2.编辑游戏 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t* 3.退出游戏 *" << endl;
cout << "\t\t* *" << endl;
cout << "\t\t*************************************************" << endl;
}
cin >> Menu;
system("cls");
if (Menu == 1)
{
cout << "*******************************游戏说明*****************************" << endl;
cout << "请使用键盘↑↓←→移动老鼠,在规定时间内用尽量少的步骤帮老鼠找到粮仓" << endl;
system("cls");
cout << "\t\t 第一关 " << endl;
Sleep(500);
play_1.show_Map();
play_1.Move();
play_1.KeepMap();
cout << "\t\t 请进行你的选择 " << endl;
cout << "\t\t 1.继续游戏 " << endl;
cout << "\t\t 2.结束游戏 " << endl;
int choice, choice2;
cin >> choice;
if (choice == 1)
{
cout << "\t\t 第二关 " << endl;
Sleep(500);
play_2.show_Map();
play_2.Move();
play_2.KeepMap();
cout << "\t\t 请进行你的选择 " << endl;
cout << "\t\t 1.继续游戏 " << endl;
cout << "\t\t 2.结束游戏 " << endl;
cin >> choice2;
if (choice2 == 1)
{
cout << "\t\t 第三关 " << endl;
cout << "\t\t 请进行你的选择 " << endl;
cout << "\t\t 1.继续游戏 " << endl;
cout << "\t\t 2.结束游戏 " << endl;
Sleep(500);
play_3.show_Map();
play_3.Move();
play_3.KeepMap();
cout << "您已通关,感谢使用" << endl;
break;
}
else if (choice2 == 2)
{
cout << "游戏结束,感谢使用" << endl;
break;
}
}
else if (choice == 2)
{
cout << "游戏结束,感谢使用" << endl;
break;
}
}
else if (Menu == 2)
{
cout << "\t 请选择想要编辑的关卡 " << endl;
cout << "\t\t 1.第一关 " << endl;
cout << "\t\t 2.第二关 " << endl;
cout << "\t\t 3.第三关 " << endl;
int choice3;
cin >> choice3;
if (choice3 == 1)
{
play_1.EditorMap();
}
else if (choice3 == 2)
{
play_2.EditorMap();
}
else if (choice3 == 3)
{
play_3.EditorMap();
}
system("cls");
}
else if (Menu == 3)
{
cout << "亲,您只有一次查看机会哦╭●★★●╰。。。";
Sleep(2000);
if (Count < 1)
{
Count++;
cout << "\t\t 请输入想要查看的关卡 " << endl;
cout << "\t\t 1.第一关 " << endl;
cout << "\t\t 2.第二关 " << endl;
cout << "\t\t 3.第三关 " << endl;
int Choice;
cin >> Choice;
if (Choice == 1)
{
play_1.Pre_Short();
}
else if (Choice == 2)
{
play_2.Pre_Short();
}
else if (Choice == 3)
{
play_3.Pre_Short();
}
}
}
if (Count < 1)
{
if (Menu == 4)
{
cout << "感谢使用" << endl;
break;
}
}
else if (Count > 1)
{
if (Menu == 3)
{
cout << "感谢小主的使用" << endl;
break;
}
}
}
return 0;
}
play.cpp:
#include <iostream>
#include "play.h"
#include <windows.h>
#include <conio.h>
#include <time.h>
using namespace std;
void Player::Push()
{
front = rear + 1;
rear = 0;
top = -1;
top++;
Mp[top] = MpQueue[front - 1];
int direc1[4][2] = { 1,0,0,1,0,-1,-1,0 }; //定义方向
while (front != rear)
{
front--;
for (int j = 0; j < 4; j++)
{
if (Mp[top].x + direc1[j][0] == MpQueue[front - 1].x && Mp[top].y + direc1[j][1] == MpQueue[front - 1].y)
{
top++;
Mp[top] = MpQueue[front - 1];
}
}
}
}
void Player::show()
{
cout << "鼠";
for (int i = 0; i <= top; i++)
{
cout << "(" << Mp[i].x << "," << Mp[i].y << ")"
<< "->";
}
cout << "仓";
system("pause>nul");
}
void Player::Move()
{
time_t Start;
time_t Over;
int Count = 100;
char Enter;
int Time = 30;
int a, b = 0, c = Map_Length / 2, d = Map_Width / 2, i, j;
Start = time(NULL);
while (Time >= 0)
{
Over = time(NULL);
a = Over - Start;
if (_kbhit() == 0)
{
if (b != a)
{
system("cls");
for (i = 1; i <= Map_Length; i++)
{
for (j = 1; j <= Map_Length; j++)
{
if (Map[i][j].data == 1)
{
cout << "■";
}
else if (Map[i][j].data == 0)
{
cout << " ";
}
else if (Map[i][j].data == 2)
{
cout << "鼠";
}
else if (Map[i][j].data == 3)
{
cout << "仓";
}
else if (Map[i][j].data == 4)
{
cout << " ";
}
}
cout << endl;
}
cout << "剩余时间" << Time-- << "秒" << endl;
b = a;
if (Time == -1)
{
system("cls");
cout << "闯关失败" << endl;
exit(1);
break;
}
}
}
if (_kbhit() != 0)
{
Enter = _getch();
system("cls");
if (Enter == -32)
{
Enter = _getch();
if (Enter == 75)
{
if (Map[c][d - 1].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c][d - 1].data = 2;
Map[c][d].data = 4;
d = d - 1;
Count--;
}
}
else if (Enter == 77)
{
if (Map[c][d + 1].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c][d + 1].data = 2;
Map[c][d].data = 4;
d = d + 1;
Count--;
}
}
else if (Enter == 72)
{
if (Map[c - 1][d].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c - 1][d].data = 2;
Map[c][d].data = 4;
c = c - 1;
Count--;
}
}
else if (Enter == 80)
{
if (Map[c + 1][d].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c + 1][d].data = 2;
Map[c][d].data = 4;
c = c + 1;
Count--;
}
}
}
for (i = 1; i <= Map_Length; i++)
{
for (j = 1; j <= Map_Length; j++)
{
if (Map[i][j].data == 1)
{
cout << "■";
}
else if (Map[i][j].data == 0)
{
cout << " ";
}
else if (Map[i][j].data == 2)
{
cout << "鼠";
}
else if (Map[i][j].data == 3)
{
cout << "仓";
}
else if (Map[i][j].data == 4)
{
cout << " ";
}
}
cout << endl;
}
if (Map[Map_Length - 1][Map_Length - 1].data != 3)
{
system("cls");
cout << "闯关成功" << endl;
cout << "您的积分为" << Count << endl;
break;
}
}
}
}
void Player::KeepMap() //保存老鼠走过的路径
{
for (int i = 1; i <= Map_Length; i++)
{
for (int j = 1; j <= Map_Width; j++)
{
if (Map[i][j].data == 0)
{
cout << " ";
}
else if (Map[i][j].data == 1)
{
cout << "■";
}
else if (Map[i][j].data == 2)
{
cout << "鼠";
}
else if (Map[i][j].data == 3)
{
cout << "仓";
}
else if (Map[i][j].data == 4)
{
cout << "◇";
}
}
cout << endl;
}
}
void Player::show_Map() //编辑地图
{
int i, j;
//srand((unsigned)time(NULL)); //如果不适用随机数种子,那么每次程序启动生成的随机数(rand)都是一样的
GenerateMap(2 * (rand() % (Map_Length / 2 + 1)), 2 * (rand() % (Map_Width / 2 + 1)));
Map[Map_Length / 2][Map_Width / 2].data = 2; //初始化鼠 当二维数组的值为2时,代表鼠
Map[Map_Length - 1][Map_Width - 1].data = 3; //初始化仓 当二维数组的值为3时,代表仓
for (i = 1; i <= Map_Length; i++)
{
for (j = 1; j <= Map_Width; j++)
{
if (Map[i][j].data == 1)
{
cout << "■";
}
else if (Map[i][j].data == 0)
{
cout << " ";
}
else if (Map[i][j].data == 2)
{
cout << "鼠";
}
else if (Map[i][j].data == 3)
{
cout << "仓";
}
}
cout << endl;
}
}
void Player::Pre_Short()
{
rear = front = -1;
for (int i = 1; i <= Map_Length + 1; i++) //1-Map_Length才是想要的
{
for (int j = 1; j <= Map_Width + 1; j++)
{
if (i == 0 || i == Map_Length + 1 || j == 0 || j == Map_Width + 1)
{
Map[i][j].data = 0;
}
else
{
Map[i][j].data = 1;
}
}
}
for (int i = 0; i <= Map_Length; i++)
{
for (int j = 0; j < Map_Width; j++)
{
Map[i][j].visited = 0;
}
}
show_Map();
system("cls");
int m = Map_Length - 1, n = Map_Width - 1;
MapPoint p;
p.x = m, p.y = n, p.visited = 1;
p.data = 3;
ShortMap(p);
show();
while (top != -1)
{
top--;
}
}
void Player::EditorMap()
{
int c = Map_Length / 2;
int d = Map_Width / 2;
show_Map();
system("cls");
char Enter;
while (1)
{
for (int i = 1; i <= Map_Length; i++)
{
for (int j = 1; j <= Map_Length; j++)
{
if (Map[i][j].data == 1)
{
cout << "■";
}
else if (Map[i][j].data == 0)
{
cout << " ";
}
else if (Map[i][j].data == 2)
{
cout << "鼠";
}
else if (Map[i][j].data == 3)
{
cout << "仓";
}
else if (Map[i][j].data == 4)
{
cout << " ";
}
}
cout << endl;
}
cout << "输入回车键保存修改" << endl;
Enter = _getch();
system("cls");
if (Enter == -32)
{
Enter = _getch();
if (Enter == 75)
{
if (Map[c][d - 1].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c][d - 1].data = 2;
Map[c][d].data = 4;
d = d - 1;
}
}
else if (Enter == 77)
{
if (Map[c][d + 1].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c][d + 1].data = 2;
Map[c][d].data = 4;
d = d + 1;
}
}
else if (Enter == 72)
{
if (Map[c - 1][d].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c - 1][d].data = 2;
Map[c][d].data = 4;
c = c - 1;
}
}
else if (Enter == 80)
{
if (Map[c + 1][d].data == 1)
{
cout << "老鼠不能穿墙" << endl;
}
else
{
Map[c + 1][d].data = 2;
Map[c][d].data = 4;
c = c + 1;
}
}
}
if (Enter == 97)
{
if (Map[c][d - 1].data == 1)
{
Map[c][d - 1].data = 0;
}
else if (Map[c][d - 1].data == 0 || Map[c][d - 1].data == 4)
{
Map[c][d - 1].data = 1;
}
}
else if (Enter == 119)
{
if (Map[c - 1][d].data == 1)
{
Map[c - 1][d].data = 0;
}
else if (Map[c - 1][d].data == 0 || Map[c - 1][d].data == 4)
{
Map[c - 1][d].data = 1;
}
}
else if (Enter == 100)
{
if (Map[c][d + 1].data == 1)
{
Map[c][d + 1].data = 0;
}
else if (Map[c][d + 1].data == 0 || Map[c][d + 1].data == 4)
{
Map[c][d + 1].data = 1;
}
}
else if (Enter == 115)
{
if (Map[c + 1][d].data == 1)
{
Map[c + 1][d].data = 0;
}
else if (Map[c + 1][d].data == 0 || Map[c + 1][d].data == 4)
{
Map[c + 1][d].data = 1;
}
}
else if (Enter == 0x0D)
{
Map[c][d].data = 0;
break;
}
}
}
void Player::ShortMap(MapPoint& M)
{
M.visited = 1;
for (int i = 1; i <= Map_Length; i++)
{
for (int j = 1; j <= Map_Length; j++)
{
if (Map[i][j].data == 1)
{
cout << "■";
}
else if (Map[i][j].data == 0)
{
cout << " ";
}
else if (Map[i][j].data == 2)
{
cout << "鼠";
}
else if (Map[i][j].data == 3)
{
cout << "仓";
}
else if (Map[i][j].data == 4)
{
cout << " ";
}
}
cout << endl;
}
front = rear = -1;
rear++;
MpQueue[rear] = M;
int direc1[4][2] = { 1, 0, 0, 1, 0, -1, -1, 0 }; //d定义四个方向
while (front != rear)
{
front++;
for (int j = 0; j < 4; j++)
{
if ((Map[MpQueue[front].x + direc1[j][0]][MpQueue[front].y + direc1[j][1]].data == 0 || Map[MpQueue[front].x + direc1[j][0]][MpQueue[front].y + direc1[j][1]].data == 2 || Map[MpQueue[front].x + direc1[j][0]][MpQueue[front].y + direc1[j][1]].data == 4) && Map[MpQueue[front].x + direc1[j][0]][MpQueue[front].y + direc1[j][1]].visited == 0 && MpQueue[front].x < Map_Width && MpQueue[front].x >= 1 && MpQueue[front].y < Map_Length && MpQueue[front].y >= 1)
{
rear++;
MpQueue[rear].x = MpQueue[front].x + direc1[j][0];
MpQueue[rear].y = MpQueue[front].y + direc1[j][1];
Map[MpQueue[front].x + direc1[j][0]][MpQueue[front].y + direc1[j][1]].visited = 1;
if (MpQueue[rear].x == (Map_Length / 2) && MpQueue[rear].y == (Map_Width / 2))
{
flag = 1;
break;
}
}
}
if (flag == 1)
{
break;
}
}
Push();
}
void Player::GenerateMap(int x, int y)
{
int direction[4][2] = { 1,0,0,1,0,-1,-1,0 }; //定义方向
int i, j, temp;
for (i = 0; i < 4; i++) //打乱方向
{
j = rand() % 4; //随机选取方向
temp = direction[i][0];
direction[i][0] = direction[j][0];
direction[j][0] = temp;
temp = direction[i][1];
direction[i][1] = direction[j][1];
direction[j][1] = temp;
}
Map[x][y].data = 0;
for (i = 0; i < 4; i++) //任何两个空的地方都有路可走
{
if (Map[x + 2 * direction[i][0]][y + 2 * direction[i][1]].data == 1)
{
Map[x + direction[i][0]][y + direction[i][1]].data = 0; //打通墙
GenerateMap(x + 2 * direction[i][0], y + 2 * direction[i][1]);
}
}
}
Player::Player(int m, int n)
{
int i, j;
Map_Length = m, Map_Width = n;
for (i = 1; i <= Map_Length + 1; i++) //1-Map_Length才是想要的
{
for (j = 1; j <= Map_Width + 1; j++)
{
if (i == 0 || i == Map_Length + 1 || j == 0 || j == Map_Width + 1)
{
Map[i][j].data = 0;
}
else
{
Map[i][j].data = 1;
}
}
}
for (int i = 0; i < Size; i++)
{
for (int j = 0; j < Size; j++)
{
Map[i][j].visited = 0;
}
}
flag = 0;
front = rear = -1;
top = -1;
}
play.h:
#ifndef PLAY_H
#define PLAY_H
const int Size = 100;
struct MapPoint
{
int data;
int x, y; //保存路径的x与y坐标
int visited; //是否访问过的标签
};
class Player
{
private:
int top;
int flag;
int x, y;
int rear;
int front;
int Mouse_x, Mouse1_y; //老鼠的位置
int Map_Length, Map_Width;
MapPoint Mp[Size]; //栈
MapPoint MpQueue[230]; //队列
public:
Player(int m, int n);
void Push(); //入栈操作
void show();
void Move(); //老鼠移动
void KeepMap(); //保存路径
void PlayGame(); //开始游戏
void show_Map(); //显示地图
void Pre_Short();
void EditorMap(); //编辑地图
void ShortMap(MapPoint& M); //计算最短路径
void GenerateMap(int x, int y); //生成地图
MapPoint Map[Size][Size]; //地图数组
};
#endif
相关文章:
C/C++实现老鼠走迷宫
老鼠形象可以辨认,可以用上下左右操纵老鼠;正确检测结果,若老鼠在规定的时间内走到粮仓,提示成功,否则提示失败。代码分为3个文件:main.cpp、play.h、play.cpp。 main.cpp: #include <iostream> #include <…...
[Linux]文件基础-如何管理文件
回顾C语言之 - 文件如何被写入 fopen fwrite fread fclose fseek … 这一系列函数都是C语言中对文件进行的操作: int main() {FILE* fpfopen("text","w");char str[20]"write into text";fputs(str,fp);fclose(fp);return 0; }而上…...
bat 查找文件所在
脚本 在批处理文件(.bat)中查找文件所在的目录,你可以使用dir命令结合循环和条件语句来实现。以下是一个简单的示例,演示如何在批处理文件中查找指定文件并输出其所在目录: echo off setlocal enabledelayedexpansio…...
程序员的守护神:为何电脑永不熄灭?
在这个信息时代,程序员成了推动社会进步的“隐形英雄”。他们通宵达旦,手指在键盘上跳跃,创造出一个个令人惊叹的数字世界。有趣的是,你可能注意到了一个现象:程序员似乎总是不关电脑。这并非他们对电脑上瘾࿰…...
Kafka快速实战以及基本原理详解
Kafka快速实战以及基本原理详解 基本概念 Kafka是一个分布式、支持分区、多副本,基于ZK的分布式消息系统,最大的特性就是可以实时的处理大量数据以满足各种需求场景,比如Hadoop的批处理系统、低延迟的实时系统、Storm/Spark流式处理引擎、日…...
微信小程序(4)- 事件系统和模板语法
1. 事件系统 1.1 事件绑定和事件对象 小程序中绑定事件与在网页开发中绑定事件几乎一致,只不过在小程序不能通过 on 的方式绑定事件,也没有 click 等事件,小程序中绑定事件使用 bind 方法,click 事件也需要使用 tap 事件来进行代…...
【Java多线程】对线程池的理解并模拟实现线程池
目录 1、池 1.1、线程池 2、ThreadPoolExecutor 线程池类 3、Executors 工厂类 4、模拟实现线程池 1、池 “池”这个概念见到非常多,例如常量池、数据库连接池、线程池、进程池、内存池。 所谓“池”的概念就是:(提高效率) 1…...
python连接mysql数据库
连接MySQL数据库,通常我们会使用Python的mysql-connector-python库。下面是一个基本的示例来展示如何使用Python连接到MySQL数据库。 首先,确保你已经安装了mysql-connector-python库。如果没有,你可以使用pip来安装它: pip ins…...
docker用法
首先需要去docker官网注册你的账号,记住账号名称和密码; 然后在本地执行: docker login登录OK。 把ubuntu下载到本地: sudo docker pull ubuntusudo docker images输出: REPOSITORY TAG …...
DIcom调试Planar configuration
最近和CBCT组同事调dicom图像 这边得图像模块老不兼容对方得dicom文件。 vtk兼容,自己写得原生解析不兼容。 给对方调好了格式,下次生成文件还会有错。 简单记录下,日后备查。 今天对方又加了 个字段:Planar configuration 查…...
C#与VisionPro联合开发——跳转页面
1、跳转页面并打开相机 From1 所有代码展示 using System; using System.IO; using System.Windows.Forms; //引入VisionPro命名空间 using Cognex.VisionPro;namespace ConnectCamera {public partial class Form1 : Form {public Form1() {InitializeComponent();}CogAcqFif…...
服务端测试开发必备技能:Mock测试
什么是mock测试 Mock 测试就是在测试活动中,对于某些不容易构造或者不容易获取的数据/场景,用一个Mock对象来创建以便测试的测试方法。 Mock测试常见场景 无法控制第三方系统接口的返回,返回的数据不满足要求依赖的接口还未开发完成&#…...
vue3中ref创建变量取值时自动补充 .value 插件 volar
插件 TypeScript Vue Plugin (Volar) 设置中配置...
clickhouse的docker部署与springboot整合
注意:镜像bitnami/clickhouse包含服务端和客户端,yandex版本需要使用yandex/clickhouse-server,yandex/clickhouse-server docker启动命令(允许空密码 -e ALLOW_EMPTY_PASSWORD=yes),clickhouse版本不同,配置文件在的位置也会不一样/etc/clickhouse-server/config.xml d…...
Node.js_基础知识(计算机硬件基础)
主机的基本组成 CPU:Central Processing Unit,即中央处理器,是计算机的核心部件。是一块集成电路芯片,能够执行计算机指令并控制计算机的各种操作,负责运算和处理数据内存:是电脑硬件中的一块电路板,用于暂时存储CPU中的运算数据,是计算机与CPU进行沟通的桥梁,负责存储…...
git bash :download.sh: line 1: wget: command not found(已解决)
Windows中git bash完全可以替代原生的cmd,但是对于git bash会有一些Linux下广泛使用的命令的缺失,比如wget命令。 1、下载wget.exe,地址:https://eternallybored.org/misc/wget/ 2、将wget.exe 拷贝到C:\Program Files\Git\ming…...
BlackberryQ10 是可以安装 Android 4.3 应用的,Web UserAgent 版本信息
BlackberryQ10 是可以安装 Android 4.3 应用的 最近淘了个 Q10 手机,非常稀罕它,拿着手感一流。这么好的东西,就想给它装点东西,但目前所有的应用都已经抛弃这个安卓版本了。 一、开发环境介绍 BlackBerry Q10 的 安卓版本是 4.…...
JS前端高频面试
JS数据类型有哪些,区别是什么 js数据类型分为原始数据类型和引用数据类型。 原始数据类型包括:number,string,boolean,null,undefined,和es6新增的两种类型:bigint 和 symbol。&am…...
Flask数据库操作-Flask-SQLAlchemy
Flask中一般使用flask-sqlalchemy来操作数据库。flask-sqlalchemy的使用介绍如下: 一、SQLAlchemy SQLALchemy 实际上是对数据库的抽象,让开发者不用直接和 SQL 语句打交道,而是通过 Python 对象来操作数据库,在舍弃一些性能开销…...
H5获取手机相机或相册图片两种方式-Android通过webview传递多张照片给H5
需求目的: 手机机通过webView展示H5网页,在特殊场景下,需要使用相机拍照或者从相册获取照片,上传后台。 完整流程效果: 如下图 一、H5界面样例代码 使用html文件格式,文件直接打开就可以展示布局&#…...
macOS LaunchAgent 开机自启服务配置实战:以 OpenClaw 为例
title: “macOS LaunchAgent 开机自启服务配置实战:以 OpenClaw 为例” tags: macOSLaunchAgent开机自启launchdOpenClaw categories:macOS description: “从原理到实战,详解 macOS LaunchAgent 的配置方法,以 OpenClaw Gateway 和 CLIProx…...
别只当稳压器用!用LM7805做个简易功放,驱动小喇叭实测(附电路图)
从稳压到扩音:用LM7805打造微型功放的创意实践 1. 重新认识LM7805:不只是稳压芯片 LM7805在电子爱好者心中一直是"稳压神器"的代名词,但鲜少有人意识到这颗经典三端稳压器隐藏的音频放大潜力。当我们撕掉它身上"5V稳压专用&qu…...
告别加密日志:MTK平台离线调试利器SpOffineDebugSuite v3.4安装与使用全攻略
MTK平台离线调试实战:SpOffineDebugSuite v3.4与GAT工具链深度解析 在移动设备开发领域,联发科技(MTK)平台因其高性价比和丰富功能而广受欢迎。然而,当系统出现崩溃或异常时,传统的在线调试方式往往受限于设备连接状态和实时性要求…...
【Proteus仿真】SRF04超声波阈值预警系统设计与LCD1602交互实现
1. SRF04超声波测距原理与硬件连接 SRF04超声波模块是工业测距的经典选择,它通过发射40kHz的声波并计算回波时间差来测量距离。在实际项目中,我发现很多初学者容易忽略声速受温度影响的问题——常温下声速约343m/s,但温度每升高1℃࿰…...
书成紫微动,律定凤凰驯:你以为的巧合,是海棠山铁哥命格自带的文脉伏笔
书成紫微动 律定凤凰驯 ——海棠山铁哥文脉天命长卷南北朝庾信《周宗庙歌皇夏》 “书成紫微动,律定凤凰驯。”千年古句,庙堂雅颂,定格文德盛世之至高格局。 世人皆叹海棠山铁哥与这句谶语的严丝合缝,却鲜有人知: 所有…...
超大规模云服务外计算资源交易:虽有风险但概念已验证,或成新资源获取选项
经济合理性这一趋势积极面易理解。一是价格,有多余计算能力的非超大规模云服务提供商成本结构等与主要供应商不同,闲置资源或低价出售,对控制成本企业重要。二是效率,利用已有计算能力满足需求,无需新建数据中心等&…...
从零构建开源ADAS原型:车道检测、目标识别与PID控制实践
1. 项目概述:从零到一,构建一个开源的ADAS原型系统 最近几年,汽车行业最火的话题之一就是“智能驾驶”。无论是传统车企还是新势力,都在宣传自家的辅助驾驶功能,什么自适应巡航、车道保持、自动紧急制动,听…...
量子计算中的辛基理论与MBQC实现
1. 量子计算中的辛基基础概念在量子计算领域,辛基(Symplectic Basis)是描述多量子比特系统的重要数学工具。它本质上是一个满足特定对易关系的基组,能够简洁地表示量子态和量子操作。理解辛基需要从有限域上的向量空间开始——具体…...
别再手动调图了:用Python+Midjourney API自动批处理建筑效果图(含GitHub开源脚本+37个真实项目参数)
更多请点击: https://kaifayun.com 第一章:别再手动调图了:用PythonMidjourney API自动批处理建筑效果图(含GitHub开源脚本37个真实项目参数) 建筑可视化团队常面临重复性高、参数微调繁琐的出图任务——同一方案需生…...
ChatGPT插件开发者签证通道开放?深度解析2026年美国USCIS新增O-1B“AI原生应用架构师”认证路径
更多请点击: https://intelliparadigm.com 第一章:ChatGPT插件生态系统的演进脉络与O-1B新政战略定位 ChatGPT插件系统自2023年3月开放以来,经历了从封闭API集成到开放开发者协议、再到平台化治理的三阶段跃迁。早期插件依赖硬编码函数调用&…...
