exercism 2023-10-13

@porkostomus bummmer, did then that one for nothing ๐Ÿ˜ž

Not at all. You get to ponder why it was deprecated and how that exercise is influenced other languages, but mostly totally meaningless in Clojure.

Also a valid point. But then first wait on mentoring on a challenge I submittted yesterday

The strange part is, that exercise was actually written for Clojure. It was the first one created for the syllabus, before we really knew what we were doing

We need an exercise for teaching maps, but I tried porting the dictionaries exercise from the C# track and it's the same situation, it's all about writing functions to create a map, add something to a map, remove an item, replace an item. All things that you actually have to learn to do in other languages, but in Clojure just amount to wrapping a core function (or in the case of creating a map, just typing 2 characters), which I can't bring myself to ask of people. There's value in porting exercises from other tracks because it provides something familiar to students who have seen the exercise before, and creates a consistent tone across the website. But I think this is a situation where I just need to write one from scratch.

I think that from my daughters perspective, the first thing for her to grasp is the concept of a mapping. We did the robot thingy together yesterday, and I did use some maps there for figuring out the next direction on a right or left move. This made sense to her. We havenโ€™t gone into mutating maps yet, although we actually did that in the robot thing, but I framed it more in terms of the update fn than on maps.

@slipset which robot one did you do then ? As far as I know there are 2 robot challenges

robot-simulator is the one with the turns

and then you have robot-name . which I think you can use a list to keep track that there are not 2 with the same name @porkostomus

I was thinking of the robot simulator

Spoiler alert ๐Ÿ™‚

(def right {:n :e
            :e :s
            :s :w
            :w :n})

(def left {:n :w
           :w :s
           :s :e
           :e :n})

(defn advance [c d]
  (cond (= d :n) (update c 1 inc)
        (= d :w) (update c 0 dec)
        (= d :s) (update c 1 dec)
        (= d :e) (update c 0 inc)))

(defn move-robot [coords inst]
  (cond (= \R inst) (update coords :d right)
        (= \L inst) (update coords :d left)
        (= \A inst) (update coords :c advance (:d coords))
        :else (do (println "this is not a legal instruction:" inst) coords)))

(reductions move-robot {:c [7 3] :d :n} "RAALALx")

that one I did not try. Looked too diffulcult for a beginner in clojure

Added the "Coordinate Transformation" exercise, which teaches atoms and closures https://exercism.org/tracks/clojure/exercises/coordinate-transformation

Thanks, looks also a complex one to learn clojure as a beginner

I ported it from the JavaScript track. I struggled with it as a student because I hadn't learned any JavaScript before, but it seemed to port to Clojure pretty nicely. The memoization part was difficult for me, but then I found an example from the Clojure documentation that fit the problem perfectly, so it's linked in the hints.

two challenges to do and then i did all the concepts one

I deprecated the lists exercise and replaced it with a new one, Card Games: https://exercism.org/tracks/clojure/exercises/card-games