del.downinit.com

January 2, 2009

del.downinit.com

January 2, 2009

January 2, 2009

Just a quick test of the syntax highlighter. Seems to be working, but it's ugly. This post also serves as a note to self to fix the bleeding stylesheet and make some readable colors.

perl Code
#!/usr/bin/perl

use strict;
use integer;

# the nth element of the fibonacci series
# param n - an int >= 0
# return an int >= 0
sub fib($) {
  my $n = shift, $a = 1, $b = 1;
  ($a, $b) = ($a + $b, $a) until (--$n < 0);
  return $a;
}

print fib(10);
Posted on: Friday, January 2, 2009 09:50pm