Module:Sandbox/Retro
This page is used to organize my WIP modules. E to the Pi times i (talk | contribs) 16:53, 7 April 2018 (UTC)
I definitely want to come back here. I've worked with LUA a bit more since I took my break, so hopefully I can jump right in (though I'm no expert LUA programmer). eπi (talk | contribs) 10:10, 7 May 2019 (UTC)
Subpages
Now I'm actually drafting some modules:
-- A LUA comment, unlike the comments of C++ and Java (which use "//" and "/* */"); and html (which uses "<!-- -->")
local p = {} -- p stands for package
function p.hello(frame)
return "Hello, world!"
end
function p.fizzbuzz(frame)
for i = 1, 100 do
outNum = ""
if i % 3 == 0 then
outNum = outNum .. "Fizz"
end
if i % 5 == 0 then
outNum = outNum .. "Buzz"
end
if outNum == "" then
outNum = i
end
mw.log(outNum)
end
end
function p.frameTest(frame)
-- This returns true, surprisingly. I wonder if they can ever be different.
return mw.getCurrentFrame() == frame
end
return p
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.