Exercism request: Fancy showing us how to do Spiral Matrix (https://exercism.io/my/solutions/b123ac5f8a0c4fe9946b314bb724febc). This is the first Exercism problem that I can’t figure out how to do in Clojure. It looks like it’d be pretty straightforward in an imperative language but I can’t figure out how you’d solve this in a functional way. (Even though there are lots of solutions on Exercism, none of them actually make sense to me!)
Sure, so long as I understand how to do it myself 😁 I'll take a look today and let you know how I get on. Thanks.
Its doesn't seems as scary as it first looks 🙂 I think with a bit of partitioning, mapping, reducing and cycling it should create a nice functional approach. I'll try get this ready for Saturday (no promises though)
Your functional programming skills are clearly pretty good… I’d be really interested to learn how to do it 😺
Solving the Spiral Matrix challenge in a functional way is a lot easier when you think about generating the index in which numbers should be placed, rather than trying to generate numbers in the right order. Hopefully the trick I am using will be made clear in the broadcast... should be an interesting one 🙂
nice
The code I'm covering tomorrow is shared on GitHub https://github.com/practicalli/exercism-clojure-guides/tree/master/spiral-matrix There is a functional approach (although its not beautiful) and a recursive function approach.