On Wed, Dec 5, 2012 at 1:11 PM, C M Caine <cmca...@googlemail.com> wrote: > > The full code is on pastebin http://pastebin.com/tUh0W5Se > >>>> import game >>>> S = game.State() >>>> S1 = S.move_state(1).move_state("SWAP") >>>> S2 = S.move_state(1) >>>> S3 = S2.move_state("SWAP") >>>> S1 == S3 > False
In lines 156-160 you change players by mutating the object. You need to use a local variable such as "next_player" and return State(board, self.turn_number + 1, next_player). Also, you're mixing tabs and 2-space indents. Please choose one or the other. The most popular style is 4-space indents, as recommended by the PEP 8 style guide. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor