(ns zipzag
	(:require [clojure.string :as str]))

(defn print-zigzag [s]
  (let [a (-> (str/replace s #"\s+" "") (str " "))
        re #(-> (str/replace a % %2) str/trimr)]
    (println (re #"(.)." "$1 "))
    (println (re #".(.)" " $1"))))

(print-zigzag "123456789")
(print-zigzag "The earth turns around the sun.")
