Sometimes you write code you’re just not super happy with.
The Diamond Kata is a simple kata to take a single character parameter, and return a “diamond” shaped string. Examples:
diamond 'A';; val it : string = "A" diamond 'B';; val it : string = " A B B A " diamond 'C';; val it : string = " A B B C C B B A " etc;;
That’s how I describe this Kata I was working on. I’m just not super happy with it. It feels wordy, and a bit inelegant. Still, it does work (as long as you pass a character ‘greater’ than upper case A. I should probably enforce that sometime… but for now, here it is.