Skip to content

Instantly share code, notes, and snippets.

@killthekitten
Last active December 10, 2015 00:29
Show Gist options
  • Save killthekitten/4352051 to your computer and use it in GitHub Desktop.
Save killthekitten/4352051 to your computer and use it in GitHub Desktop.
XMas written with CoffeeScript flavor
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<pre>
</pre>
arr = (size, sym = '+') ->
(new Array(size))
alert(arr(3).join('+'))
space = (s, t = 0) ->
(arr s).concat(arr t, '*').sort(-> 0.5 - Math.random()).join('')
a = for l in [0..7]
"#{space(9-l)}/#{space(l*2, l > 1 ? 3 : 0 + l)}\\\n"
$('pre').append a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment