Last active
March 17, 2016 18:29
-
-
Save mbaltrusitis/65816f994b58acb9bae4 to your computer and use it in GitHub Desktop.
Revisions
-
mbaltrusitis revised this gist
Mar 17, 2016 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -106,7 +106,6 @@ def find_winners(tourny): rght = find_winners(right) final_faceoff = (left, rght) winner = find_winners(final_faceoff) return winner if isinstance(left, str) and isinstance(right, str): -
mbaltrusitis revised this gist
Mar 17, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -113,8 +113,6 @@ def find_winners(tourny): print("\n\n{} VS. {}".format(left, right)) winner = random.choice([left, right]) print("{} wins!".format(winner)) return winner -
mbaltrusitis created this gist
Mar 17, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,124 @@ #!/usr/bin/python """Randomly select your March Madness bracket. """ import random south = ( ( ( ('Kansas', 'Austin Peay'), ('Colorado', 'Connecticut'),), ( ('Maryland', 'South Dakota St.'), ('California', 'Hawaii'), ) ), ( ( ('Arizona', 'Vanderbilt/Wichita St.'), ('Miami', 'Buffalo'), ), ( ('Iowa', 'Temple'), ('Villanova', 'UNC Asheville'), ) ) ) west = ( ( ( ('Oregon', 'Holy Cross/Southern'), ('Saint Joseph\'s', 'Cincinnati'),), ( ('Baylor', 'Yale'), ('Duke', 'UNC Wilmington'), ) ), ( ( ('Texas', 'Northern Iowa'), ('Texas A&M', 'Green Bay'), ), ( ('Oregon St.', 'Virginia Commonwealth'), ('Oklahoma', 'Cal St. Bakersfield'), ) ) ) east = ( ( ( ('North Carolina', 'FGCU/Fairleigh Dickinson'), ('USC', 'Providence'),), ( ('Indiana', 'Chattanooga'), ('Kentucky', 'Stony Brook'), ) ), ( ( ('Notre Dame', 'Michigan/Tulsa'), ('West Virginia', 'Stephen F. Austin'), ), ( ('Wisconsin', 'Pittsburgh'), ('Xavier', 'Weber St.'), ) ) ) midwest = ( ( ( ('Virginia', 'Hampton'), ('Texas Tech', 'Butler'),), ( ('Purdue', 'Little Rock'), ('Iowa State', 'Iona'), ) ), ( ( ('Seton Hall', 'Gonzaga'), ('Utah', 'Fresno St.'), ), ( ('Dayton', 'Syracuse'), ('Michigan St.', 'Middle Tennessee'), ) ) ) tournamet = ( (south, west), (east, midwest) ) def find_winners(tourny): left, right = tourny if isinstance(left, tuple) and isinstance(right, tuple): left = find_winners(left) rght = find_winners(right) final_faceoff = (left, rght) winner = find_winners(final_faceoff) global teams_left return winner if isinstance(left, str) and isinstance(right, str): print("\n\n{} VS. {}".format(left, right)) winner = random.choice([left, right]) print("{} wins!".format(winner)) global teams_left teams_left = teams_left - 1 return winner if __name__ == '__main__': print("thinking...") final_winner = find_winners(tournamet) print("\n\nTHE BIG WINNER IS {}".format(final_winner.upper()))