local fn ThueMorse( s as Str255 ) as Str255 Str255 k short i k = "" for i = 1 to len$(s) if mid$(s, i, 1) == "1" k += "0" else k += "1" end if next end fn = s + k local fn DoIt Str255 tm short i tm = "0" print tm for i = 1 to 7 tm = fn ThueMorse( tm ) print tm next end fn fn DoIt HandleEvents