-
Notifications
You must be signed in to change notification settings - Fork 0
Unzip
The listutils:unzip2 function unzips a list that contains sublists of length 2.
Input is given using the listutils:in storage:
| Field | Meaning |
|---|---|
List |
The list to unzip. |
After defining the input, run the function listutils:unzip2.
Errors that display when executing the listutils:unzip2 function as a player in debug mode.
| Error | Message |
|---|---|
| TBD | TBD |
The success of the operation is stored in the $listutils.success listutils.out score. This score is 1 on success and 0 otherwise. The success is always 1 when not run in debug mode.
The result of the operation is stored in the List and ZipList fields in the listutils:out storage and contains the unzipped lists. The List field will always contain the first elements of all sublists.
Take the example list ExampleList: [["foo", "baz"],["Hello World!", "foo"],["foo", "bar"]]:
# Add Lists to the input.
data modify storage listutils:in List set from storage listutils:examples ExampleList
# Call the function.
function listutils:unzip2This would return List: ["foo", "Hello World!", "foo"], ZipList: ["baz", "foo", "bar"] in the listutils:out storage.