level 3
随意随缘随心情
楼主
tolog = function(str)
local file = io.open("log.txt","a")
str = "["..os.date().."]: "..str.."\n"
file:write(str)
end
for i = 1 ,100000000 ,1 do
if math.mod(i,1000) == 0 then
tolog(i+x)
end
end
代码,以上,输出的log.txt
[11/25/13 11:58:10]: 8000
[11/25/13 11:58:10]: 7000
[11/25/13 11:58:10]: 6000
[11/25/13 11:58:10]: 5000
[11/25/13 11:58:10]: 4000
[11/25/13 11:58:10]: 3000
[11/25/13 11:58:10]: 2000
[11/25/13 11:58:10]: 1000
[11/25/13 11:58:10]: 11000
[11/25/13 11:58:10]: 10000
[11/25/13 11:58:10]: 9000
这是为啥啊?这顺序是什么情况?求大神指点一下
2013年11月25日 04点11分
1
local file = io.open("log.txt","a")
str = "["..os.date().."]: "..str.."\n"
file:write(str)
end
for i = 1 ,100000000 ,1 do
if math.mod(i,1000) == 0 then
tolog(i+x)
end
end
代码,以上,输出的log.txt
[11/25/13 11:58:10]: 8000
[11/25/13 11:58:10]: 7000
[11/25/13 11:58:10]: 6000
[11/25/13 11:58:10]: 5000
[11/25/13 11:58:10]: 4000
[11/25/13 11:58:10]: 3000
[11/25/13 11:58:10]: 2000
[11/25/13 11:58:10]: 1000
[11/25/13 11:58:10]: 11000
[11/25/13 11:58:10]: 10000
[11/25/13 11:58:10]: 9000
这是为啥啊?这顺序是什么情况?求大神指点一下