in reply to Re^6: Derangements iterator (callbacks)
in thread Derangements iterator

Notwithstanding the fact that I bungled the code somewhere...what you call "my program" is effectively a translation of jdporter's program. Translated properly, it will return exactly the same results in exactly the same order. I've located my mistake and fixed.

Caution: Contents may have been coded under pressure.
  • Comment on Re^7: Derangements iterator (callbacks)