代码搜索:Lua
找到约 9,588 项符合「Lua」的源代码
代码结果 9,588
www.eeworm.com/read/404808/11477832
lua echo.lua
-- echo command line arguments
for i=0,table.getn(arg) do
print(i,arg[i])
end
www.eeworm.com/read/404808/11477833
lua sieve.lua
-- the sieve of of Eratosthenes programmed with coroutines
-- typical usage: lua -e N=1000 sieve.lua | column
-- generate all the numbers from 2 to n
function gen (n)
return coroutine.wrap(function
www.eeworm.com/read/404808/11477834
lua xd.lua
-- hex dump
-- usage: lua xd.lua < file
local offset=0
while true do
local s=io.read(16)
if s==nil then return end
io.write(string.format("%08X ",offset))
string.gsub(s,"(.)",
function (c) io.w
www.eeworm.com/read/404808/11477835
lua cf.lua
-- temperature conversion table (celsius to farenheit)
for c0=-20,50-1,10 do
io.write("C ")
for c=c0,c0+10-1 do
io.write(string.format("%3.0f ",c))
end
io.write("\n")
io.write("F ")
for c=c
www.eeworm.com/read/404808/11477836
lua factorial.lua
-- function closures are powerful
-- traditional fixed-point operator from functional programming
Y = function (g)
local a = function (f) return f(f) end
return a(function (f)
www.eeworm.com/read/404808/11477837
lua hello.lua
-- the first program in every language
io.write("Hello world, from ",_VERSION,"!\n")
www.eeworm.com/read/404808/11477838
lua sort.lua
-- two implementations of a sort function
-- this is an example only. Lua has now a built-in function "sort"
-- extracted from Programming Pearls, page 110
function qsort(x,l,u,f)
if l
www.eeworm.com/read/403227/11520567
doc lua.doc
www.eeworm.com/read/344225/11898852
lua autofringe.lua
-- Autofringe Script
-- Robert Edwards 2003
-- This script is in the public domain and can be used for any purpose
-- I just hope its useful.
function ShowError(message)
mappy.msgBox("E
www.eeworm.com/read/344225/11898854
lua placer.lua
-- Example Placer script
-- called when the mouse moves and a button pressed that is set to Placer.lua
function main ()
local x = mappy.getValue (mappy.MOUSEBLOCKX)
local y = mappy.getValue (m