This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-13
Channels
- # ai (5)
- # announcements (4)
- # babashka (34)
- # beginners (78)
- # biff (6)
- # calva (41)
- # cider (47)
- # clerk (1)
- # clj-commons (3)
- # clj-http (1)
- # clojure (72)
- # clojure-europe (51)
- # clojure-nl (1)
- # clojure-norway (87)
- # clojure-romania (1)
- # clojure-uk (5)
- # clojuredesign-podcast (2)
- # community-development (1)
- # conjure (2)
- # cursive (11)
- # datomic (6)
- # docker (4)
- # emacs (13)
- # exercism (20)
- # hyperfiddle (56)
- # matrix (6)
- # membrane (4)
- # nbb (11)
- # off-topic (88)
- # pathom (7)
- # pedestal (1)
- # polylith (20)
- # portal (16)
- # practicalli (1)
- # re-frame (13)
- # reagent (4)
- # reitit (2)
- # remote-jobs (7)
- # shadow-cljs (49)
- # sql (4)
I deprecated the lists exercise and replaced it with a new one, Card Games: https://exercism.org/tracks/clojure/exercises/card-games
@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
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")
Added the "Coordinate Transformation" exercise, which teaches atoms and closures https://exercism.org/tracks/clojure/exercises/coordinate-transformation
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.