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