summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan DeMasi <me@jrdemasi.com>2020-06-19 15:14:09 -0600
committerJonathan DeMasi <me@jrdemasi.com>2020-06-19 15:14:09 -0600
commit6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8 (patch)
treef65df610b4f2f63054e7c388ca1fd0f635415591
downloadprojects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.tar
projects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.tar.gz
projects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.tar.bz2
projects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.tar.lz
projects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.tar.xz
projects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.tar.zst
projects-6cedb58fc6acfcbf5cfbc8e2541e0d3c67e88bc8.zip
init first project
-rwxr-xr-xpython_beer_bracket/main.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/python_beer_bracket/main.py b/python_beer_bracket/main.py
new file mode 100755
index 0000000..3c4e311
--- /dev/null
+++ b/python_beer_bracket/main.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+
+import random
+
+beers = {
+ 0: "Labatt Blue Light",
+ 1: "Miller Lite",
+ 2: "Coors Light",
+ 3: "Keystone Light",
+ 4: "Bud Light Platinum",
+ 5: "Bud Light",
+ 6: "Michelob Ultra",
+ 7: "Saint Archer Gold",
+ 8: "Busch Light",
+ 9: "Heineken Light",
+ 10: "Miller High Life Light",
+ 11: "Amstel Light"
+}
+
+pairs = []
+seen = []
+
+def rand_int():
+ return random.randint(0, 11)
+
+def print_beers():
+ counter = 1
+ for pair in pairs:
+ print("Matchup {0} is {1} and {2}".format(counter, beers[pair[0]], beers[pair[1]]))
+ counter = counter + 1
+ return
+
+def main():
+ while len(pairs) < 6:
+ int1 = rand_int()
+ while int1 in seen:
+ int1 = rand_int()
+ int2 = rand_int()
+ while int2 in seen or int2 == int1:
+ int2 = rand_int()
+ seen.append(int1)
+ seen.append(int2)
+ pair = (int1, int2)
+ pairs.append(pair)
+ print_beers()
+ return
+
+if __name__ == '__main__':
+ main() \ No newline at end of file