dance-moves-gen - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- dance-moves-gen (1325B) --- 1 #!/usr/bin/env python 2 # coding=utf-8 3 4 import os 5 import sys 6 import getopt 7 import random 8 9 def usage(app): 10 app = os.path.basename(app) 11 print("usage: %s [-h] [-n moves]" % (app), file=sys.stderr) 12 sys.exit(1) 13 14 def main(args): 15 ascii_moves = ["\\o/", "\\o_", "_o_", "_o/", "~o/", "\\o~", "~o~", 16 "-o/", "\\o-", "-o-", "\\o.", ".o/", ".o.", 17 "\\o7", "_o7", "-o7", ".o7", "~o7", "\\^o^/", 18 "\\^o_", "_o^/", "~o^/", "\\^o~", "-o^/", 19 "\\^o-", "\\^o.", ".o^/", "\\^o7", 20 "(>OoO)>", "<(OoO<)", "/o/", "\\o\\"] 21 egyptian_moves = [ 22 "𓀀", "𓀁", "𓀂", "𓀃", "𓀉", "𓀊", 23 "𓀋", "𓀏", "𓀐", "𓀒", "𓀓", "𓀔", 24 "𓀕", "𓀖", "𓀞", "𓀟", "𓀠", "𓀡", 25 "𓀢", "𓀣", "𓀤", "𓀥", "𓁌", "𓁎", 26 "𓁏"] 27 try: 28 opts, largs = getopt.getopt(args[1:], "hemn:") 29 except getopt.GetoptError as err: 30 print(str(err)) 31 usage(args[0]) 32 33 nmoves=10 34 moves=ascii_moves 35 for o, a in opts: 36 if o == "-h": 37 usage(args[0]) 38 elif o == "-e": 39 moves=egyptian_moves 40 elif o == "-n": 41 nmoves = int(a) 42 elif o == "-m": 43 moves=egyptian_moves+ascii_moves 44 else: 45 assert False, "unhandled option" 46 47 ostr = "" 48 for i in range(nmoves): 49 if len(ostr) > 0: 50 ostr += " " 51 ostr += random.choice(moves) 52 53 print("%s" % (ostr)) 54 55 return 0 56 57 if __name__ == "__main__": 58 sys.exit(main(sys.argv)) 59