forked from gregglind/programmingwithsquirrels
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrockpaperscissors.py
More file actions
41 lines (31 loc) · 849 Bytes
/
rockpaperscissors.py
File metadata and controls
41 lines (31 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
ans = raw_input("Choose: rock, paper, scissors\n").strip()
import random
their = random.choice(['rock','paper','scissors'])
print "theirs is", their
if ans == 'rock':
if their == 'scissors':
print 'rock breaks scissors'
if their == 'rock':
print 'rock ties rock'
if their == 'paper':
print 'paper covers rock'
if ans == 'scissors':
if their == 'scissors':
print 'scissors ties scissors'
if their == 'rock':
print 'rock ties scissors'
if their == 'paper':
print 'scissors cuts paper'
if ans == 'paper':
if their == 'scissors':
print 'scissors cuts paper'
if their == 'rock':
print 'paper covers rock'
if their == 'paper':
print 'paper ties paper'
"""
So what stinks here?
* lots of repeated text
* if vs elif
* only plays once
"""