practicalli (youtube)

Exercism request: Fancy showing us how to do Spiral Matrix ( 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!)

practicalli-john 2020-11-12T11:02:55.149500Z

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.

practicalli-john 2020-11-12T12:25:13.152800Z

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 😺

practicalli-john 2020-11-13T16:51:13.153200Z

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 🙂



practicalli-john 2020-11-13T23:18:30.155200Z

The code I'm covering tomorrow is shared on GitHub There is a functional approach (although its not beautiful) and a recursive function approach.