Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Created July 25, 2015 19:31
Show Gist options
  • Save trikitrok/378a8af7d9a4295a93f5 to your computer and use it in GitHub Desktop.
Save trikitrok/378a8af7d9a4295a93f5 to your computer and use it in GitHub Desktop.
Print Diamond kata

#Print Diamond kata

Given a letter, print a diamond starting with ‘A’ with the supplied letter at the widest point.

For example:

(print-diamond "A") will print

  A

(print-diamond "B") will print

  A
 B B
  A

(print-diamond "C") will print

  A
 B B
C   C
 B B
  A

and so on.

Source: Seb Rose's blog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment