--一些大型遊戲需要對資料的整理,這樣便於修改和統一管理還有修改。常見的有js和csv
--csv 其實就是都好分割的簡單文字結構,所以當作一般的文本來處理就好了,js需要解析,有現成的解析庫
function getline( filename )
index = 0
myline = {}
for line in io.lines(string.format("%s%s","d:/lua/",filename)) do
index = index + 1
myline[index] = line
endreturn index,myline
enda,b = getline("tab1.csv")
print("index:",a)
for i=1,#b do
print(b[i])
end--[[ "tab1.csv"
id name age class
1 liuxin 22 5
2 qiqi 23 1
3 qian 13 6
4 nannan 24 3
]]
lua備忘錄(一)
lua中有八種基本型別,需要注意的是 function thread nil這三種型別 print type 10.0 使用type函式可以獲得乙個變數的型別資訊 print type false print type 123 邏輯運算 a 30 b 20 c a b and a or b lua中...
jquery學習備忘錄
語法解釋 1.select id change function 為select新增事件,當選擇其中一項時觸發 2.var checktext select id find option selected text 獲取select選擇的text 3.var checkvalue select id...
ATL 學習備忘錄
1.編繹錯誤 error lnk2005 x already defined in atlmincrt.lib atlinit.obj 解決辦法 開啟release版本的專案配置項,把configuration properties general minimize crt use in atl設定...