Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Genious Algorithm: Factorial Tree Sort

Name: Anonymous 2011-06-02 2:57


 Factorial Tree Sort reads an array of integers and randomly arranges the order of those integers. It then checks to see if the array is sorted, if the array is sorted, Factorial Tree Sort has done its job. If the array is not sorted

(Post truncated.)

Name: Anonymous 2011-06-02 6:39

>>24

a = 3

def foo():
    a = 2

foo()    # foo should set the outer a to 2
print a  # so this should print '2'

This prints 3, due to a naive mistake that Guido made early on, one that has permanent and far-reaching implications to the usability of the language. For what it's worth, Larry Wall made the same mistake with Perl, Matz made it with Ruby, and Strachan appears to be making it all over again in Groovy. It's a common blunder.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List