
lua
Zaki陌
..
展开
-
lua中操作符的优先级
lua中操作符的优先级原创 2021-06-03 11:50:25 · 483 阅读 · 0 评论 -
lua-unpack
手册中的解释:unpack (list [, i [, j]])Returns the elements from the given list. This function is equivalent to return list[i], list[i+1], ···, list[j]原创 2020-07-24 12:03:34 · 641 阅读 · 0 评论 -
用lua实现STL中vector、list、map相应功能
用lua模拟实现vector、list、map相应部分功能vector:at(index),push_back(val),erase(index),size(),iter()list:empty(),push_back(data),push_front(data),pop_back(),pop_front(),size(),clear(),front(),back(),iter()map:insert(k,v),erase(k),size(),find(k),clear(),iter()原创 2020-07-24 10:05:21 · 1589 阅读 · 0 评论 -
lua 区分中文和中文符号
网上了解到 中文的ASC码 区间是 0xe4b880 - 0xe9bfbf 也就是228 184 128 -- 233 191 191function PersonCenterView:checkWord(str) if #str > 0 and #str/3%1 == 0 then --判断是否全部为中文 for i=1,#str,3 do原创 2017-04-10 12:08:14 · 1979 阅读 · 0 评论 -
lua math库(备忘)
函数名描述示例结果pi圆周率math.pi3.1415926535898abs取绝对值math.abs(-2012)2012ceil向上取整math.ceil(9.1)10floor向下取整math.floor(9.9)原创 2017-02-17 14:27:54 · 367 阅读 · 0 评论