From 526d00080846381958e9fb845bfad67b6e708968 Mon Sep 17 00:00:00 2001 From: hellerve Date: Mon, 2 May 2016 20:28:01 +0200 Subject: [PATCH] updated zeptosay; embarassingly ugly --- .scripts/zeptosay.zp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.scripts/zeptosay.zp b/.scripts/zeptosay.zp index 8b00477..9a8ffd9 100644 --- a/.scripts/zeptosay.zp +++ b/.scripts/zeptosay.zp @@ -1,3 +1,12 @@ (load "ascii.zp") -(cowsay (string-substitute (string-substitute (fold (lambda (x y) (++ x y)) "" args) "\n" " ") " " " ")) +(let ((trimmed (|> (delay (string:join zepto:args)) + (lambda (x) (string:substitute x "\t" " ")) + string->list + list->vector + (curry vector:reduce + (lambda (acc x) (if (eq? (vector:last acc) x) acc (++ acc x))) + {}) + vector->list + list->string))) + (ascii:cowsay trimmed)) ""