Module snippet
Random junk.
Module Status: Work in progress forever.
Usage:
local snippet = require('__eradicators-library__/erlib/factorio/snippet')()
Todo
todo1 | Nothing. |
Section
compact_repr_arr_of_string(arr, target_length) | Compresses an array of random strings to fit into as fewest lines of as code possible. |
Todo
Section
- compact_repr_arr_of_string(arr, target_length)
-
Compresses an array of random strings to fit into as fewest lines of
as code possible. Does not respect element order obviouly. Used to better
encode long lists of stuff.
Parameters:
- arr DenseArray
- target_length NaturalNumber
Returns:
Usage:
local r={}; for i=1,10 do r[#r+1] = ('0'):rep(i) end print(snippet.compact_repr_arr_of_string(r,22)) > { "0000000000","000000", "000000000","0000000", "00000000","00000", "0000","000","00","0", }