WhyLua---------------------------------------------一个功能强大,快速,轻量级,可嵌入的脚本语言。程序语法构造简单,用关键数组来实现强大的数据描述功能,同时还提供一些可扩展的语义特征动态类型,无需编译,由解释器先翻译成lua虚拟机的指令,然后在虚拟机(基于寄存器实现)..
分类:
其他好文 时间:
2014-08-13 03:44:16
阅读次数:
338
assert(loadstring("math.max(7,8,9)"))dofile("scripts/xxx.lua")math.floor()math.random() math.random(10, 100)math.min(3,4,5) math.max(2,3,4)num = tonum...
分类:
其他好文 时间:
2014-08-12 18:56:54
阅读次数:
208
代码如下,里面有注释,应该能看懂。function getFile(file_name) local f = assert(io.open(file_name, 'r')) local string = f:read("*all") f:close() return str...
分类:
系统相关 时间:
2014-08-12 18:51:24
阅读次数:
981
==============变量类型nilnumber(实数) 1 2 3.14 7.65e8string "hello world" "\n"boolean(true false) true falsefunction*userdata and threadstable(1)默认key初始化t.....
分类:
其他好文 时间:
2014-08-12 18:49:34
阅读次数:
201
lua 中处理cocos2dx 的button 事件 2014-05-08 09:44:32|分类: lua |举报 |字号订阅 1、引入这个类:require "GuiConstants"2、下面是回调函数的处理.local function menuZhuCeCallback(sender,ev...
分类:
其他好文 时间:
2014-08-12 18:43:14
阅读次数:
208
(1)添加文件核路径(2)库文件路径(3)main.cpp#include #include extern "C"{ #include #include #include }#pragma comment(lib, "lua51.lib")#pragma comment(lib, "lua5.1.....
分类:
其他好文 时间:
2014-08-12 18:37:14
阅读次数:
172
转自:Lua模式匹配模式匹配函数在string库中功能最强大的函数是:string.find(字符串查找)string.gsub(全局字符串替换)string.gfind(全局字符串查找)string.gmatch(返回查找到字符串的迭代器)这些函数都是基于模式匹配的。与其他脚本语言不同的是,Lua...
分类:
其他好文 时间:
2014-08-12 18:20:24
阅读次数:
357
1.Lua保留字:and break do else elseifend false for funct...
分类:
其他好文 时间:
2014-08-12 18:13:24
阅读次数:
177
#!/bin/bash
#unzip?zip&tar?file
function??untarfile(){
for?i?in?$(?ls?.?|grep?-v?.sh)
do
val=$(echo?$i?|?grep?".zip$"?|wc?-l)
if?[[?"$val"??-eq??1?]];then
dirname=$(echo?...
分类:
其他好文 时间:
2014-08-12 17:47:04
阅读次数:
237
原地址:http://blog.segmentfault.com/hongliang/1190000000631630Cocos2d-x下Lua调用自定义C++类和函数的最佳实践关于cocos2d-x下Lua调用C++的文档看了不少,但没有一篇真正把这事给讲明白了,我自己也是个初学者,摸索了半天,总...
分类:
编程语言 时间:
2014-08-12 16:49:04
阅读次数:
371