Skip to content

Instantly share code, notes, and snippets.

@jnozsc
Last active December 23, 2016 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnozsc/a4fc47356b3968d0a99a6c5b0b3e4f82 to your computer and use it in GitHub Desktop.
Save jnozsc/a4fc47356b3968d0a99a6c5b0b3e4f82 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
from random import shuffle
GUEST_NAME = [
u'阿仁',
u'sk',
u'lulu',
u'えるし',
u'S',
u'熊猫叔',
u'崭崭',
u'呆鲑',
u'オラララ',
u'阿源',
u'周游',
u'许可',
u'周璟',
u'YZ',
u'阿花',
]
def main(person):
if person < 2 or person > len(GUEST_NAME):
print 'invalid input'
exit()
x = range(person)
done = False
while (not done):
shuffle(x)
done = True
for idx, val in enumerate(x):
if idx == val:
done = False
break
y = range(person)
shuffle(y)
for i in y:
print GUEST_NAME[i], '->', GUEST_NAME[x[i]]
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="hehe")
parser.add_argument('--person', type=int,
default='15')
args = parser.parse_args()
main(args.person)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment