Skip to content

Instantly share code, notes, and snippets.

@tanishiking
Created May 1, 2015 15:53
Show Gist options
  • Save tanishiking/eacd90819fa410e5adf7 to your computer and use it in GitHub Desktop.
Save tanishiking/eacd90819fa410e5adf7 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
class ManagerCreator(object):
u"""プリパラマイマネ問題検証用スクリプト"""
color = [u'赤', u'橙', u'黄', u'緑', u'水', u'青', u'紫']
animal = [u'熊', u'兎', u'鳥', u'鼠', u'猫']
def get_manager(self, name):
uni_code_point = ord(name)
ani, col = divmod(uni_code_point % 35, 7)
return (self.animal[ani], self.color[col])
if __name__ == '__main__':
creator = ManagerCreator()
list_of_hiragana = [unichr(i) for i in range(ord(u"あ"), ord(u"ん")+1)]
for char in list_of_hiragana:
animal, color = creator.get_manager(char)
print "%s: %s %s" % (char, color, animal)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment