            "     "
            "     "])
 
+;; function outer
 (defn replace-ws-with-char [strings replacer] 
   (map #(str/replace % #"\s" replacer) strings))
 
 (def r (replace-ws-with-char life "0"))
 
+;; function outer
 (defn table->matrix [table]
   (map #(str/split % #"") table))
 
 (def matrix (table->matrix r))
 matrix
 
-;[row col]
-;[0 0]:: [0 1] [1 0] [1 1]
-;
 ;[1 1]:: [0 0] [0 1] [0 2]
 ;        [1 0]       [1 2]
 ;        [2 0] [2 1] [2 2]
 
-
+;; function inner
 (defn gen-neighbours-by-row [[row col] row-func]
+  "function that generates neighbours for given coordinate by applying the row-func
+   which can be any of: inc(neighbours-for-next-row), dec(neighbours-for-previous-row)"
   (letfn [(clean-alien-cels [cels-coordinates]
             (filter (fn [cell-coordinate]
                       (= 2 (count (remove neg? cell-coordinate))))

(ns clojure-learning.game-of-life)
(require '[clojure.string :as str])

;Each cell interacts with its eight neighbours (horizontal, vertical, diagonal)
;1) Any live cell with fewer than two live neighbours dies, as if caused by under-population.
;2) Any live cell with two or three live neighbours lives on to the next generation.

      (map vec (gen-neighbours-by-row [row col] next-row-func))
    )))
    
;; testing
(gen-neighbours-for [0 1]) 
;; ((0 0)   ..   (0 2)
;;  (1 0) (1 1)  (1 2))

;; function outer
(defn transpose-table->positions 
  "given a matrix of cells(0 1) this function will map each dump-cell with it's corresponding
   coordinates on the table"
  [[head-row-with-cols & tail-rows] row-counter transposed-table-acc]
    (letfn [(generate-row-with-cols-tuple [row-counter cols-counter]
              (map vec 
