Hi Leif,
> you just need to consolidate the more concrete steps. Something like: > flip-bottom-up -> flip (or vertical- and horizontal-flip) > join-together-side-by-side -> beside > put-one-on-top-of-the-other -> stack (or ontop, or ...) > reverse-every-row -> (map reverse rows) ; very readable to clojure > programmers flip: which way? flip-vertically: yes, that may be good enough after all. I went for flip-bottom-up because I didn't want the reader to have to ask themselves: what does he mean by vertical flip? e.g. if you search google images for vertical flip you get both of the following images: <https://lh5.googleusercontent.com/-dNAVKelygfo/VI0pMSemS9I/AAAAAAAAAOQ/J5fLWi_ACzI/s1600/Screen%2BShot%2B2014-12-14%2Bat%2B06.05.19.png> <https://lh5.googleusercontent.com/-HH-ZnujIaHM/VI0o_hOJQ9I/AAAAAAAAAOI/BrM10DB97Mc/s1600/Screen%2BShot%2B2014-12-14%2Bat%2B06.05.10.png> beside: genius! that is what I looked for, but could not come up with. stack: yes, that was my first choice, but then I worried that a foreign reader might not be familiar with the word (which I don't hear that often), or that a developer might think about FILO, etc. I think I did consider 'above' (in the vein of your 'beside'), but discarded it. I think put-one-on-top-of-the-other is pretty irritating in some respects. I can see beside and above working well. Thanks, Philip On Tuesday, 9 December 2014 05:06:22 UTC, Leif wrote: > > Hi, Philip. > > I had the same urge as David--I tried it out, glossing over any formal > rules. Here's what I came up with: > https://gist.github.com/leifp/ae37c3b6f1b497f13f1e > > In truth, I think David's solution is more readable and maintainable. But > I think "maintainability" is a pretty tricky concept: > > My code makes a seq of maps describing rows, and then turns them into > strings at the end. This is probably more work to understand than David's > solution. But is it less maintainable? Well, currently, the answer is > "yes," but what if I need to output a diamond in several different > formats? What if marketing wants each row to be a different color and > font? I would start to favor my solution in that case. My point is that > the difference between "maintainable" and "horrible" is evident, but the > difference between "maintainable" and "easily maintainable" depends on > predicting the future somewhat. > > I also favor a slightly less verbose style. A function is an abstraction, > and you seem to be writing functions for very concrete steps. I think you > have most of the correct abstractions for your solution method, you just > need to consolidate the more concrete steps. Something like: > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.