Skip to content

Instantly share code, notes, and snippets.

@macrat
Created May 14, 2015 06:46
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 macrat/a2398d15f049fe288ce1 to your computer and use it in GitHub Desktop.
Save macrat/a2398d15f049fe288ce1 to your computer and use it in GitHub Desktop.
pythonでもやっぱり一行でじゃんけんをしようかと思ったのでした。EOFErrorには勝てなかったよ。
(lambda hands : (lambda usr, cpu: print('usr: {0}\ncpu: {1}\n{2}'.format(hands[int(usr)], hands[cpu], ('drow :-)', 'lose...', 'your win!!')[(3+int(usr)-cpu)%3]) if usr.isdigit() and 0 <= int(usr) <= 2 else 'incorrect input!'))(input('jan! ken!! game!!!\nplease your hand(0:{0}, 1:{1}, 2:{2}):'.format(*hands)), __import__('random').randint(0, 2)))(('guu', 'choki', 'paa'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment