Saturday, November 15, 2008

Testing code highlighting

I'm giving Google's code highlighting library a try


def subsets(elements, size):
""" Generates all subsets of the given size of the given set.
"""
if size > 0:
while len(elements) > 0:
first = elements.pop()
for the_rest in subsets(elements.copy(), size-1):
yield (first,)+the_rest
else:
yield ()



The colors are a tad funky, given my choice of background, but it works!

Instructions are here.

1 comments:

Nick said...

What chapter are you on TECS