From a0fb2c8bfd2259e2436bbd1d659db97c48ba977f Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sun, 7 Jun 2015 15:15:48 +0200 Subject: [PATCH] rps --- rps.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 rps.py diff --git a/rps.py b/rps.py new file mode 100644 index 0000000..360830e --- /dev/null +++ b/rps.py @@ -0,0 +1,9 @@ +#!/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])) +