diff --git a/episode-001/boutdecode.lua b/episode-001/boutdecode.lua new file mode 100644 index 0000000..856e019 --- /dev/null +++ b/episode-001/boutdecode.lua @@ -0,0 +1,49 @@ + +-- En provenance de https://github.com/bluebird75/luaunit/blob/4d1db2a3ab84acb56ac37ea3357913882e15019a/luaunit.lua#L220 +-- luaunit + +local function strsplit(delimiter, text) +-- Split text into a list consisting of the strings in text, separated +-- by strings matching delimiter (which may _NOT_ be a pattern). +-- Example: strsplit(", ", "Anna, Bob, Charlie, Dolores") + if delimiter == "" then -- this would result in endless loops + error("delimiter matches empty string!") + end + local list, pos, first, last = {}, 1 + while true do + first, last = text:find(delimiter, pos, true) + if first then -- found? + table.insert(list, text:sub(pos, first - 1)) + pos = last + 1 + else + table.insert(list, text:sub(pos)) + break + end + end + return list +end +M.private.strsplit = strsplit + + +-- Version sans les commentaires + + +local function strsplit(delimiter, text) + if delimiter == "" then + error("delimiter matches empty string!") + end + local list, pos, first, last = {}, 1 + while true do + first, last = text:find(delimiter, pos, true) + if first then -- found? + table.insert(list, text:sub(pos, first - 1)) + pos = last + 1 + else + table.insert(list, text:sub(pos)) + break + end + end + return list +end +M.private.strsplit = strsplit + diff --git a/episode-001/boutdecode.txt b/episode-001/boutdecode.txt new file mode 100644 index 0000000..70b3570 --- /dev/null +++ b/episode-001/boutdecode.txt @@ -0,0 +1,20 @@ + +local function strsplit(delimiter, text) + if delimiter == "" then + error("delimiter matches empty string!") + end + local list, pos, first, last = {}, 1 + while true do + first, last = text:find(delimiter, pos, true) + if first then -- found? + table.insert(list, text:sub(pos, first - 1)) + pos = last + 1 + else + table.insert(list, text:sub(pos)) + break + end + end + return list +end +M.private.strsplit = strsplit + diff --git a/participantes.md b/participantes.md new file mode 100644 index 0000000..e3364d8 --- /dev/null +++ b/participantes.md @@ -0,0 +1,10 @@ +Les personnes participantes sont: + +- COULIBALY Souleymane +- Alexandra Dupouy-Derry +- Estelle Le Goasduff +- Élodie Pelcat +- Sarah B + +- Alexandre Jigmond +