A
Size: a a a
A
PP
mapv
: https://clojuredocs.org/clojure.core/mapvST
PP
PP
PP
pr
?ST
(with-open [rdr (BufferedReader. (StringReader. "1 0 0\n0 1 0\n0 0 1"))]
(mapv #(read-string (str "[" % "]"))
(line-seq rdr)))
ST
(with-open [rdr (BufferedReader. (StringReader. "1 0 0\n0 1 0\n0 0 1"))]
(mapv #(read-string (str "[" % "]"))
(line-seq rdr)))
[[1 0 0] [0 1 0] [0 0 1]]
A
A
[[1 0 0] [0 1 0] [0 0 1]]
ST
IG
(require '[clojure.string :as str])
(defn read-matrix [filename]
(let [content (slurp filename)
lines (str/split content #"\n")]
(mapv (fn [line]
(str/split line #"\s+")) lines)))
(read-matrix "file.txt")
[["1" "0" "0"]
["0" "1" "0"]
["0" "0" "1"]]
A
(require '[clojure.string :as str])
(defn read-matrix [filename]
(let [content (slurp filename)
lines (str/split content #"\n")]
(mapv (fn [line]
(str/split line #"\s+")) lines)))
(read-matrix "file.txt")
[["1" "0" "0"]
["0" "1" "0"]
["0" "0" "1"]]
IG
ST
(require '[clojure.string :as str])
(defn read-matrix [filename]
(let [content (slurp filename)
lines (str/split content #"\n")]
(mapv (fn [line]
(str/split line #"\s+")) lines)))
(read-matrix "file.txt")
[["1" "0" "0"]
["0" "1" "0"]
["0" "0" "1"]]
str/split-lines
IG
IG
(defn read-matrix [filename]
(let [content (slurp filename)
lines (str/split-lines content)]
(mapv (fn [line]
(read-string (format "[%s]" line))) lines)))
(read-matrix "file.txt")
[[1 0 0] [0 1 0] [0 0 1]]
RN
EM
RN