diff options
| -rw-r--r-- | challenge-096/gugod/janet/ch-1.janet | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-096/gugod/janet/ch-1.janet b/challenge-096/gugod/janet/ch-1.janet new file mode 100644 index 0000000000..f3d0e18544 --- /dev/null +++ b/challenge-096/gugod/janet/ch-1.janet @@ -0,0 +1,15 @@ + +(defn reverse-words + "Reverse the string word by word" + [S] + (string/join (reverse (filter (fn [x] (not (= x ""))) + (string/split " " S))) + " ")) + +# main +(loop [x :in @["The Weekly Challenge" + " Perl and Raku are part of the same family " + "join reverse split $S"]] + (print (string + "Input: " x "\n" + "Output: " (reverse-words x)))) |
