#82 : (help) I need additional error message

32 views
Skip to first unread message

gluer

unread,
Nov 19, 2018, 6:00:30 AM11/19/18
to 4Clojure

Hi. I'm gluer in South Korea.



Today I have met a problem. 


I have solved #82 on emacs-cider environments. but 4clojure says only "You failed the unit test."


Can I see additional error message on web browser?


My solution is as follows.


Thanks for your attention.



(fn [y]
  (let [f (fn f [x s]
          (let [vs (into [] (map #(into [] %) s))
                vx (into [] x)
                f0 (fn f1 [x]
                     (let  [ m (for [y (range (count x))] (remove #(= y %) (range (count x))))]
                       (set (map #(into [] (map x %)) m))))
                f1 (fn [a b]
                     (if (= (count a) (count b))
                       (if (= (apply + (map #(if (= % %2) 0 1) a b)) 1)
                         true
                         false)
                       (if (> (count a)(count b))
                         (if ((f0 a) b) true false)
                         (if ((f0 b) a) true false))))]
            (set (map #(apply str %)  (filter #(f1 vx %) vs)))))
        z (fn z [x s r]
          (let [xf (f (first x) s)
                xf1 (first xf)
                xf2 (second xf)]
            (if (empty? xf)
              r
              (list
               (z xf (disj s xf1) (conj r xf1))
               (z (rest xf) (disj s xf2) r)))))
        re (filter #(= % y) (flatten (map #(flatten (z (vector %) (disj y %) (set (list %)))) y)))]
    (if (= '() re) false true)))

 

gluer

unread,
Nov 19, 2018, 11:47:48 PM11/19/18
to 4Clojure
Today I have made other solution like this and passed.
Thanks for your attention.

(fn  [words]
  (let [f0 (fn  [x]
             (let  [ m (for [y (range (count x))] (remove #(= y %) (range (count x))))]
               (set (map #(apply str %) (map #(into [] (map (into [] x) %)) m)))))
        f1 (fn [a b]
             (if (= (count a) (count b))
               (if (= (apply + (map #(if (= % %2) 0 1) a b)) 1)
                 true
                 false)
               (if (> (count a)(count b))
                 (if ((f0 a) b) true false)
                 (if ((f0 b) a) true false))))
        neighbor_m (apply hash-map  (flatten (map #(list % (set (filter (fn [z] (f1 % z)) words))) words)))
        ff (fn ff [word result]
             (let [avail (clojure.set/difference (neighbor_m word) result)]
               (if (empty? avail)
                 result
                 (list
                  (ff (first avail) (conj result (first avail)))
                  (if (second avail)
                    (ff (second avail) (conj result (second avail)))
                    result)))))]
    (if (empty? (filter #(= % words) (flatten (map (fn [z] (flatten (ff z #{z}))) words)))) false true)))




2018년 11월 19일 월요일 오후 8시 0분 30초 UTC+9, gluer 님의 말:

Norbert hu

unread,
Nov 10, 2019, 9:09:49 PM11/10/19
to 4Clojure
Today I met the same question, and  cann't get the detail error message.

maybe the clojure's version of 4clojure.com is different to mine.

在 2018年11月20日星期二 UTC+8下午12:47:48,gluer写道:

Bill Allen

unread,
Nov 10, 2019, 9:17:15 PM11/10/19
to 4Clojure
Looking at the 4clojure github site, it appears that it is running clojure 1.4. So, compatibility with recent versions might be an issue.

--
You received this message because you are subscribed to the Google Groups "4Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 4clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/4clojure/e69c0e5a-b447-4c97-83b2-b111fcd5d14a%40googlegroups.com.

Seungmin Park

unread,
Nov 11, 2019, 5:21:55 PM11/11/19
to 4clo...@googlegroups.com
Thanks for your attention and kindness.^^
Have a nice day~

2019년 11월 11일 (월) 오전 11:17, Bill Allen <bi...@k2bea.org>님이 작성:
Reply all
Reply to author
Forward
0 new messages