updated zeptosay
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
(load "ascii.zp")
|
(load "ascii.zp")
|
||||||
|
(define cowsay (import "ascii:cowsay"))
|
||||||
(let ((trimmed (|> (delay (string:join zepto:args))
|
(let ((trimmed (|> (delay (string:join zepto:args))
|
||||||
(lambda (x) (string:substitute x "\t" " "))
|
(lambda (x) (string:substitute x "\t" " "))
|
||||||
string->list
|
string->list
|
||||||
list->vector
|
list->vector
|
||||||
(curry vector:reduce
|
(curry vector:reduce
|
||||||
(lambda (acc x) (if (eq? (vector:last acc) x) acc (++ acc x)))
|
(lambda (acc x) (if (and (eq? x " ") (eq? (vector:last acc) x))
|
||||||
|
acc
|
||||||
|
(++ acc x)))
|
||||||
{})
|
{})
|
||||||
vector->list
|
vector->list
|
||||||
list->string)))
|
list->string)))
|
||||||
(ascii:cowsay trimmed))
|
(cowsay trimmed))
|
||||||
""
|
""
|
||||||
|
Reference in New Issue
Block a user