one-file-projects/rps.py
2015-06-07 15:15:48 +02:00

9 lines
219 B
Python

#!/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]))