summaryrefslogtreecommitdiff
path: root/papanoel.py
diff options
context:
space:
mode:
authorRaul Benencia <rul@kalgan.cc>2019-12-16 18:50:22 -0800
committerRaul Benencia <rul@kalgan.cc>2019-12-16 18:50:22 -0800
commiteb5a8746df672cb3444a7cf4f4a56d9481e3a56a (patch)
treecbc8ff22975c4ca3cd91c3beb6544959dde25f54 /papanoel.py
parentec6a317261861b40710d2cfcd71934571e4be792 (diff)
secret santaHEADmaster
Diffstat (limited to 'papanoel.py')
-rwxr-xr-xpapanoel.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/papanoel.py b/papanoel.py
new file mode 100755
index 0000000..9c9d362
--- /dev/null
+++ b/papanoel.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python3
+# Poor's man Secret Santa
+
+import random
+import sys
+
+def main():
+ people = []
+
+ for person in sys.stdin:
+ people += [person.rstrip()]
+
+ random.shuffle(people)
+ amount = len(people)
+ for i in range(amount):
+ print("{} -> {}".format(people[i], people[(i + 1) % amount]))
+
+if __name__ == "__main__":
+ main()
nihil fit ex nihilo