To work on this, you must have successfully finished the task "[Lua task #2] Use Lua on English Wikipedia" before!
You can write your own Lua functions using your sandbox module to try out code. You can then use your sandbox to call a function from your module and see how well it works.
Make sure you understand that the module begins by defining an empty table, then defines functions (adding them to the table), and finally returns the table.
- Copy the following questions into your sandbox (not your module sandbox):
Which letter is conventionally used in Scribunto modules to hold the table of functions?
What keyword marks the start of a function definition?
What keyword marks the end of a function definition?
- Write your answers to the 3 questions in your sandbox.
- In your module sandbox you should just have a comment (-- Google Code-in 2017, Introduction to Lua in Wikipedia). On a new line write another similar comment with the name of this task.
Save the module.
- Below that comment, copy all of the code needed to produce the hello function from the example
Include the initial line beginning local ..., and the final line beginning return ....
Save the module.
- Work out what you need to write in your sandbox in order to call the hello function from your module sandbox. Write that in your sandbox and test it by previewing the edit. When you have no errors, save the sandbox.