I recently discovered self-modifying bit-wise cyclic tags and started developing a program that stimulates its behavior.
delete from console import def SBCT (program): index = 0 t = 0 during the program: clear() print (& # 39; step% d: & # 39;% t) Print (program) print (& # 39; & # 39; * index + & # 39; & # 39; h = int (program[index]) if h == 0: # clears the first program bit Program = program[1:] if program: index% = len (program) otherwise: # appends the appropriate bit if the first bit is one index = (index + 2)% len (program) program + = int (program) * h * program[(index-1)%len(program)] t + = 1 word = & # 39; 1011110111 & # 39; SBCT (word)
It seems to match the behavior of the sample string (defined here as
word) on the page of the language, as well as for smaller examples that I can tell. The problem is that, for the given example, it seems to be messing up in the long run. The page states that the program finishes in 43074 steps, but the program does not seem to end up with my code. Since there were no further steps for the review, I can not say how I made a mistake. Could someone please point out where I am wrong when he sees it?