Lua - VScode 开发环境搭建

本文介绍了如何在VSCode中安装和配置Lua插件,包括VSCode-icons、Lua Debug和CodeRunner,以便于Lua程序的开发和调试。同时,详细讲解了Lua编译环境的配置,提供了一个Binaries-LuaDist的下载链接,并指导了环境变量的设置。在测试代码段中,展示了如何编写和运行一个简单的Lua函数。最后,提到了LuaDebug的.launch.json配置文件的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

IDE首先还是  ZeroBrane Studio ,当然也可以使用 VSCode

一、VScode 插件安装配置

vscode-icons、Lua Debug、Code Runner

为方便调试运行程序,需要对code runner 做如下配置

二、Lua 编译环境配置

Binaries-LuaDist-batteries-0.9.8-Windows-x86.zip 下载地址 http://luadist.org/

下载完成之后解压,并将bin路径配置到环境变量path中。完成之后 windows + R lua -v验证 是否成功

三、LUA开发测试

测试代码:

function max(num1, num2)

if (num1 > num2) then
result = num1;
else
result = num2;
end

return result;
end

print("The maximum of the two numbers is ",max(10,4))
print("The maximum of the two numbers is ",max(5,6))

运行结果:

四、Lua debug

. launch.json文件配置

参考:

https://blog.csdn.net/yanwennian/article/details/103524744

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值