代码搜索:Lua
找到约 9,588 项符合「Lua」的源代码
代码结果 9,588
www.eeworm.com/read/154878/11921248
dsp lua.dsp
# Microsoft Developer Studio Project File - Name="lua" - Package Owner=
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Conso
www.eeworm.com/read/154878/11921262
opt lua.opt
www.eeworm.com/read/154878/11921271
c lua.c
/*
** $Id: lua.c,v 1.122 2003/04/03 13:34:42 roberto Exp $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
#include
#include
#include
#include
www.eeworm.com/read/154878/11921284
lua readonly.lua
-- make global variables readonly
local f=function (t,i) error("cannot redefine global variable `"..i.."'",2) end
local g={}
local G=getfenv()
setmetatable(g,{__index=G,__newindex=f})
setfenv(1,g)
-
www.eeworm.com/read/154878/11921287
lua undefined.lua
-- catch "undefined" global variables
local f=function (t,i) error("undefined global variable `"..i.."'",2) end
setmetatable(getfenv(),{__index=f})
-- an example
a=1
c=3
print(a,b,c) -- `b' is undef
www.eeworm.com/read/154878/11921290
lua bisect.lua
-- bisection method for solving non-linear equations
delta=1e-6 -- tolerance
function bisect(f,a,b,fa,fb)
local c=(a+b)/2
io.write(n," c=",c," a=",a," b=",b,"\n")
if c==a or c==b or math.abs(a-b)
www.eeworm.com/read/154878/11921295
lua table.lua
-- make table, grouping all data for the same item
-- input is 2 columns (item, data)
local A
while 1 do
local l=io.read()
if l==nil then break end
local _,_,a,b=string.find(l,'"?([_%w]+)"?%s*(.*)
www.eeworm.com/read/154878/11921297
lua fib.lua
-- fibonacci function with cache
-- very inefficient fibonacci function
function fib(n)
N=N+1
if n
www.eeworm.com/read/154878/11921301
lua printf.lua
-- an implementation of printf
function printf(...)
io.write(string.format(unpack(arg)))
end
printf("Hello %s from %s on %s\n",os.getenv"USER" or "there",_VERSION,os.date())