Wikimedia

Lua Task 4 - Loops and tables

Before you work on this task, you should have completed the task "Lua Task 3 - Calculations and tests".

This task requires some independent learning and is more difficult.

Lua has several control structures that govern program flow, and one principal data structure, the table, which can represent the arrays, lists, sets, sequences and objects found in other programming languages. Tables may be nested and are made up of keys (or indexes) and values. Both keys and values can be any Lua value except nil and NaN. Setting a key to have a value of nil effectively removes that entry from the table.

Read through and then carry out the instructions at: https://en.wikipedia.org/wiki/User:RexxS/GCI-Task04

For the first part, you should have added a new function to your module sandbox and five test cases to your user sandbox. For the second part, you should have added a new function to your module sandbox and one test case to your user sandbox.

Please make sure that you save each page every time you are instructed to.

When you have finished to your satisfaction, please leave a comment here when you submit your work, and give the urls of your module sandbox and your user sandbox, something like:

https://en.wikipedia.org/wiki/Module:Sandbox/RexxS

https://en.wikipedia.org/wiki/User:RexxS/sandbox

Task tags

  • lua
  • scribunto
  • control structures
  • data structures

Students who completed this task

jaimeiji, MrSpecjal, m.young.20, Priyanshu001, Cyborg Coder, smsingh, How222, Deimos, artbarte, mogmog123, wwdjbox, StoppedGalaxy, Filip Korthals, mdu, boboquack, dxa_kly, lux, stibba, Shreeniket, Shreyas Minocha, takidelfin, Robin Gan, Jan Rosa, Vemu, safan41, Shah Jahan, Nathan, Anirudh Prabhakaran, Sarai, gnsJhenJie, angr_pukhlya, Xiaowan, Chan, stella, OHM OMAR, cheddarooz

Task type

  • code Code
  • chrome_reader_mode Documentation / Training
close

2018