Monday, March 29, 2010

Syntax Highlighting Test

Straightforward quicksort algorithm taken from wikipedia to test syntax highlighting within blogger:

def qsort1(lst):
    if len(lst) <= 1:
        return lst
    pivot = lst.pop(0)
    greater_eq = qsort1([i for i in lst if i >= pivot])
    lesser = qsort1([i for i in lst if i < pivot])
    return lesser + [pivot] + greater_eq

The idea has been borrowed from this blog post and SyntaxHighlighter can be found here.

3 comments:

  1. Excellent.
    But you should do something about this awfull green color. Honestly. For your own good. And mine (I might throw up if I continue reading it and I'm guessing there will be code examplespretty often on this blog ;-)

    Cheers

    ReplyDelete
  2. Hello Mia,

    I actually liked the color scheme. However since you're my only reader so far... I'll see what I can do to prevent you from becoming sick reading this blog :-)

    ReplyDelete
  3. Yeay, that's a lot better! Not really pretty but completely readable!

    ReplyDelete