one-file-projects/rps.py

10 lines
219 B
Python
Raw Normal View History

2015-06-07 15:15:48 +02:00
#!/usr/bin/env python3
t = ["rock","paper","scissors"]
w = ["draw","win","lose"]
p = lambda you,enemy: w[ t.index(you)-t.index(enemy)]
if __name__ == "__main__":
from sys import argv
print(p(argv[1],argv[2]))