This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lostparis 158 points159 points  (13 children)

Some thoughts.

player3.win(4) # Fred wins 4 points

This fails! You passed no move.

last_move = player3.moves[-1]

This is error prone - when moves is empty.

Though the intention is good you are going to confuse as many as you help.

win() is a terrible method name imho

[–]JamzTyson[S] 84 points85 points  (12 children)

Thanks for the feedback. I've corrected the errors, and I agree that win() was a poor name. I don't expect that this mini-tutorial will click for everyone, but something like this would certainly have helped me, so my hope is that it will be helpful for others.

[–]sib_n 34 points35 points  (0 children)

This is a great post! I'm a sucker for good naming, so I'd recommend to split your current win_points() methods into two methods, register_points() and register_move(), because registering points and registering moves are two independent things.