> I have checked out the iterators thematic tutorial and I must say, it's 
> really helpful. Thank you for recommending that.

Glad to hear :-)

> Seems like the is_king_tableau throws away the tableaux that have 2
> in the 2nd-row 1st column. After that, it displays all other
> tableaux. I tried implementing a condition that goes over the list
> and throws away the undesired tableaux but haven't been successful
> yet.

If something is fishy, it's in the is_king_tableau. Make sure that
function does what you want.

    sage: def is_king_tableau(t,no_of_rows):
    ....:     for i in range(no_of_rows):
    ....:         if t[0][0] != 1:
    ....:             return False
    ....:         elif t[i][0] <= 2*i:
    ....:             return False
    ....:         else:
    ....:             i=i+1
    ....:     return True

The i=i+1 is suspicious. If you really want to consider rows of even
index, it's more explicit to use range(0, no_of_rows, 2).

Also the t[0][0] might as well be outside of the loop since it does
not depend on i.

Cheers,
                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/20200311215941.GO3535%40mistral.

Reply via email to