However, tis the season, and it's time to decorate the tree! The decorations we have available are '0', '@', '*', and '+', and of course, we have a '*' for the top of the tree. Thus, given a tree of $h = 5 and a 'decoration fraction' of $f=0.3, the decorated tree might look something like:For $h = 5: = === ===== ======= =========
* ==@ 0=*== ==+==*= @===0+==*
Thus, given a tree height $h, and a decoration fraction $f (which is the chance that any particular part of the tree will be decorated, save for the top of the tree), golf a solution that will print the decorated tree to STDOUT.
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
In reply to (Golf) Decorating the Christmas Tree by Masem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |