Gray code orders for
q-ary words avoiding a given factor
This paper constructs Gray code orders for $q$-ary words that avoid a given forbidden factor. The orders are built from generalized BRGC (Binary Reflected Gray Code) relations, establishing a generating algorithm that generalizes earlier results from 2001 and a recent work by some of the present authors. The approach also utilizes ultimate periodicity of infinite words and word matching techniques, offering an alternative to Squire's 1996 construction.