Re: [Tutor] more rps

2006-08-15 Thread Bob Gailer
FWIF Here's my "minimalist" version: # rock paper scissors import random media = ('rock', 'paper', 'scissors') outcome = ('tie', 'human', 'computer') winner = ((0,2,1), (1,0,2), (1,2,0)) print 'Human Computer Winner' while 1: h = "rpsvq".find(raw_input('Rock Paper Scissors Verify Quit').lo

Re: [Tutor] more rps

2006-08-15 Thread Luke Paireepinart
[snip] > > class Computer: > >def __init__(self): > > self.points = 0 > > self.choice = " " > > > > def plays(self): > > comp_choice = random.randint(0,2) > > if comp_choice == 0: > >self.choice = 'rock' > > elif comp_choice == 1: > >self.choice = 'paper'

Re: [Tutor] more rps

2006-08-15 Thread Alan Gauld
Let me start by saying that your code is pretty much OK as is. Indeed even using clssses for an RPS game is probably overkill to some extent.   What follows should be seen more as some ideas for experimentation and building towards a more flexible/expandable architecture for future pr

Re: [Tutor] more rps

2006-08-15 Thread Wolfram Kraus
On 15.08.2006 08:42, Christopher Spears wrote: > Here is the latest version of my Rock, Paper, Scissors > game: > > #!/usr/bin/python > > import random > random.seed() > > class Human: > def __init__(self): > self.points = 0 > self.choice = " " >

[Tutor] more rps

2006-08-14 Thread Christopher Spears
Here is the latest version of my Rock, Paper, Scissors game: #!/usr/bin/python import random random.seed() class Human: def __init__(self): self.points = 0 self.choice = " " def plays(self): fromUser = raw_input("Pi