Alexander Alexander Schmolck <[EMAIL PROTECTED]> writes: > I can think of two nice ways in J, 13 and 16 characters long respectively and > each expressing something essential and non-trival about the problem in a way > that would be more cumbersome in python. > > Here's the first one: > > (,,.~)^:4,'*' NB. due to Cliff Reiter, slightly adapted
Well, not as interesting as your solution, but definitively less mind-boggling and much more flexible/extendible ==================================================== l = [True] pr = {True: '*', False: ' '} for k in range(15): print ''.join([pr[x] for x in l]) l = [True] + [l[i+1]^l[i] for i in range(len(l)-1)] + [True] ==================================================== more elegant solutions sought! tnoo -- http://mail.python.org/mailman/listinfo/python-list