"Robert Voigtländer" <[email protected]> a écrit dans le message de news:[email protected]...
Let be L the number of lines and C the numbers of column You solve your problem just with counting on base C On base C, a number may be represented with N(L-1)N(L-2) ... N(0)N(0) where N(i) goes from 0 to C-1 N(i) is associated with line i of your array. Lines are numbered from 0 if N(i) == j, then bit in column j of line i is 1 and all others 0, columns are numbered from 0 For example, with an array of 2 lines and 3 colums 00 --> 100 < line 1 100 < line 0 01 -> 100 010 02 -> 100 001 10 -> 010 100 11 -> 010 010 12 -> 010 001 20 -> 001 100 21 -> 001 010 22 -> 001 001 -- https://mail.python.org/mailman/listinfo/python-list
