![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
脚本
文章平均质量分 77
liangneo
这个作者很懒,什么都没留下…
展开
-
用MoonScript实现算术表达式解析
--chekck token is number isnumber = (exp) -> tonumber(exp) ~= nil isspace = (c) -> c == ' ' or c == '\t' len = (exp) -> string.len(exp) --trim space trim = (exp ,pos) -> while pos <= len(exp) and原创 2014-10-18 01:13:33 · 2181 阅读 · 0 评论 -
将json转化为lua中的表
在游戏开发中,经常使用json作为配置文件,lua作为脚本,虽然在lua中读取json不算太麻烦,但是如果预先将json转换为lua中的表,不但在脚本中操作方便,也省去了在游戏中加载json的时间,因此写了一个python 脚本将json配置文件直接转化为lua中的table,代码如下: import json import types def space_str(layer):原创 2015-01-06 17:05:52 · 25486 阅读 · 2 评论