Skip to content

Instantly share code, notes, and snippets.

View icebreaker's full-sized avatar
👽
Code gardening!

Mihail Szabolcs icebreaker

👽
Code gardening!
View GitHub Profile
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
@icebreaker
icebreaker / think.markdown
Created March 12, 2009 12:24 — forked from csexton/think.markdown
Note to self.

Note to Self

Be Confident

Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.

Be Lazy

//Tower of Hanoi
//No of calls made for n disks is equal to pow(2,n) -1.
void hanoi(int n, char a, char c, char b)
{
if(n==1)
{
printf("\nShift disk 1 from %c to %c",a,c);
return ;
}