|
| 08 Nov 2016 06:47 AM |
--The "head". of the list - start at nil local head = nil -- Each entry becomes a new head, with a "next" member pointing to the old head head = {next = head, value = "d"} head = {next = head, value = "c"} head = {next = head, value = "b"} head = {next = head, value = "a"} --Pick an entry to start iterating from local entry = head -- while there is another node to move to while entry do -- print the value of the current node print(entry.value) -- move to next node entry = entry.next end |
|
|
| Report Abuse |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 08 Nov 2016 07:06 AM |
The code is self-explanatory with the comments and all. So I'm assuming you don't understand tables.
|
|
|
| Report Abuse |
|