christmas tree
Name:
Anonymous
2008-12-24 22:21
(define (christmasTree h)
(define (foo k)
(if (< k 1)
"" (string-append " " (foo (- k 1)))))
(define (bar k)
(if (< k 1)
"\n" (string-append "*" (bar (- k 1)))))
(define (ct i)
(if (= i (+ h 1))
(string-append
(foo (- h 1))
(bar 1))
(string-append
(foo (- h i))
(bar (- (* 2 i) 1))
(ct (+ i 1)))))
(display (ct 1)))
#;1> (christmasTree 10)
*
***
*****
*******
*********
***********
*************
***************
*****************
*******************
*
Name:
Anonymous
2008-12-27 20:32
#!/bin/bash
[ -z "$1" ] && exit
l='*'
s=' '
for i in $(seq 1 $1)
do
echo -n "$(echo "$s" | cut -b$i-$1)"
echo "$l"
l=$(echo "$l" | sed 's/^/*/' | sed 's/$/*/')
done
echo "$(echo "$s" | cut -b-$1)*"
Name:
Anonymous
2008-12-27 20:53
>>81
#!/bin/sh
n=$(($1+0))
stars='*'
for i in $(seq 1 $n); do
printf "%$(($n+$i-1))s\n" "$stars"
stars="**$stars"
done
printf "%${n}s\n" '*'
Name:
Anonymous
2008-12-27 20:54
Name:
Anonymous
2008-12-27 20:56
#include <stdio.h>
#define a(e) for(s=0;s<(e);s++)
#define x(a) putchar((a)^040);
#define f x(n);x(040|n)
int main(int argc, char **argv) {
int s,l=1,n=10;for(;l<=n;l++){a(n-l)x(0);
a(((l-1)<<1)+1)f;}a(n)x(0);f;return 0;}
Name:
Anonymous
2008-12-27 21:21
>>84
#include <stdio.h>
#define a(e,i) for((i)=1;(i)<=(e);++(i))
#define x(a) putchar((a)^040)
#define f x(n);x(040|n)
int main(void){int i,j,n=10;a(n,i){a(n-i,j)x(0);
a(((i-1)<<1)+1,j)f;}a(n-1,i)x(0);f;return 0;}
Name:
Anonymous
2008-12-27 21:59
>>> tree = lambda k: '\n'.join(' '*(k-n-1)+'*'*2*n+'*' for n in map(k.__rmod__,range(k+1))
Name:
Anonymous
2008-12-27 22:10
lol iteration
Name:
Anonymous
2009-03-06 17:47
▲
▲ ▲
▲ ▲ ▲
▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲ ▲
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼ ▼
▼ ▼ ▼ ▼
▼ ▼ ▼
▼ ▼
▼
Name:
Anonymous
2009-03-06 20:35
Name:
Anonymous
2009-03-06 21:12
>>89
A yellow rupee? For me?
Name:
Anonymous
2009-03-06 21:57
#!/usr/bin/ruby
puts Array.new(11){|e|(e>9&&e=0;'*'*e*2)+'*'}.map!{|e|e.center(19)}
Name:
Anonymous
2009-03-06 22:01
"GRUNNA"
Name:
Anonymous
2009-03-06 22:06
"GRANDMA"
am i doint rite
Name:
Anonymous
2009-03-06 22:08
"GRANDMASTER"
Name:
Anonymous
2009-03-06 23:06
>>7 still makes me feel warm and fuzzy when I look at it.
Name:
Anonymous
2009-03-07 0:48
Name:
Anonymous
2009-03-07 6:24
Name:
Anonymous
2009-08-16 22:59
Lain.
Name:
Anonymous
2011-02-03 8:31