Skip to content

Instantly share code, notes, and snippets.

@oliwer
Last active April 5, 2019 15:09
Show Gist options
  • Save oliwer/36ee5d0bcd542e7c2f764f3510fda4e7 to your computer and use it in GitHub Desktop.
Save oliwer/36ee5d0bcd542e7c2f764f3510fda4e7 to your computer and use it in GitHub Desktop.
Diamond in K7 (shakti)
/ diamond challenge in K7
/ http://badcode.rocks/2019/060/diamond/
/ usage: k diamond.k Z
ci:(*.z.x(1))-65 / get first arg as int (A=0)
diam:{ch:`c$x+65;ch,((0|x+x-1)#" "),(x>0)#ch}
{pad:(ci-x)#" ";pad,diam[x],pad}'(!ci+1),|!ci
\\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment