You are reading a single comment by @PaddeK and its replies. Click here to read the full conversation.
  • Are functions as replacement supported? I would love to be able to use my RunlengthEncoding snippets.

    let RLE = {
        enc: t => t.replace(/([^\d])\1*/g, m => m.length > 1 ? m.length + m[0] : m[0]),
        dec: t => t.replace(/(\d+)([^\d])/g, (m, r, c) => new Array(+r + 1).join(c))
    }
    

    -- Edit --
    I did flash this version on my espruino wifi and it seems to work!
    But i run into LOW MEMORY issues while using RLE.dec with a ~5k chars long string.

About

Avatar for PaddeK @PaddeK started