>>> from match3 import Match3 >>> m = Match3(5, 7) >>> m[0,0] = 5 >>> m[0,6] = 2 >>> m[1,2] = 3 >>> m[2,1] = 1 >>> m[2,2] = 4 >>> m[2,3] = 1 >>> m[3,4] = 5 >>> it = iter(m) >>> for t in it: ... print(t, end='-') (0, 0, 5)-(0, 6, 2)-(1, 2, 3)-(2, 1, 1)-(2, 2, 4)-(2, 3, 1)-(3, 4, 5)- >>> next(it, 'final') # Comprovem que l'iterador s'ha exhaurit 'final' >>> m[1,4] = 3 >>> m[3,2] = 3 >>> m[4,2] = 1 >>> m[2,4] = 5 >>> for t in m: ... print(t, end='-') (0, 0, 5)-(0, 6, 2)-(1, 2, 3)-(1, 4, 3)-(2, 1, 1)-(2, 2, 4)-(2, 3, 1)-(2, 4, 5)-(3, 2, 3)-(3, 4, 5)-(4, 2, 1)- --fi-enunciat