代码搜索:Lua
找到约 9,588 项符合「Lua」的源代码
代码结果 9,588
www.eeworm.com/read/290224/8494943
1 lua.1
.\" $Id: lua.man,v 1.11 2006/01/06 16:03:34 lhf Exp $
.TH LUA 1 "$Date: 2006/01/06 16:03:34 $"
.SH NAME
lua \- Lua interpreter
.SH SYNOPSIS
.B lua
[
.I options
]
[
.I script
[
.I args
]
]
.SH DESCRIPT
www.eeworm.com/read/290224/8494952
css lua.css
body {
color: #000000 ;
background-color: #FFFFFF ;
font-family: sans-serif ;
text-align: justify ;
margin-right: 20px ;
margin-left: 20px ;
}
h1, h2, h3, h4 {
font-weight: normal ;
font-styl
www.eeworm.com/read/290224/8495032
c lua.c
/*
** $Id: lua.c,v 1.160.1.2 2007/12/28 15:32:23 roberto Exp $
** Lua stand-alone interpreter
** See Copyright Notice in lua.h
*/
#include
#include
#include
#include
www.eeworm.com/read/290224/8495204
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/290224/8495206
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/290224/8495209
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/290224/8495210
lua fib.lua
-- fibonacci function with cache
-- very inefficient fibonacci function
function fib(n)
N=N+1
if n
www.eeworm.com/read/290224/8495212
lua printf.lua
-- an implementation of printf
function printf(...)
io.write(string.format(...))
end
printf("Hello %s from %s on %s\n",os.getenv"USER" or "there",_VERSION,os.date())
www.eeworm.com/read/290224/8495214
lua fibfor.lua
-- example of for with generator functions
function generatefib (n)
return coroutine.wrap(function ()
local a,b = 1, 1
while a
www.eeworm.com/read/290224/8495216
lua globals.lua
-- reads luac listings and reports global variable usage
-- lines where a global is written to are marked with "*"
-- typical usage: luac -p -l file.lua | lua globals.lua | sort | lua table.lua
while