User blog:SuperJedi224/Turing Machines

Thue-Morse Sequence
10 state - 5 color 0 * a r 1 1 a 0 r s1 1 b 1 r s0 1 * * l * s0 _ 0 l sc1 s1 _ 1 l sc1 sc1 _ * r e2 sc1 a * l sc3 sc1 b * l sc3 sc1 * * l * sc3 a * l * sc3 b * l * sc3 * * r sc2 sc2 a 0 r s1 sc2 b 1 r s0 sc2 _ * l e1   e1 _ * r e2 e1 * * l * e2 0 a r * e2 1 b r * e2 _ * l ret ret * * l * ret _ _ r 1
 * * * r *

\(\lfloor log_{2} \, n \rfloor\)
n is a base-10 positive integer given as input, fails to halt for n=1 for some reason

15 state - 11 color 0 _ * l A 0 * * r *

A 1 0 l B A 2 1 l B A 3 2 l B A 4 3 l B A 5 4 l B A 6 5 l B A 7 6 l B A 8 7 l B A 9 8 l B A 0 9 l * A _ * r Z
 * Right column counts down in base 10

B _ * l C B * * l *

C _ 1 r E C * * * D

D 0 1 r E D 1 0 l * D _ 0 * *
 * Left column counts up in base 2

E _ * r 0 E * * r *

Z _ * * AA Z * _ r *
 * Cleanup

AA _ * l * AA * _ l BB
 * Count the bits, less 1

BB _ * l CC BB * * l BB

CC _ 0 r DD CC * * * EE

DD _ * r FF

EE 0 1 * GG EE 1 2 * GG EE 2 3 * GG EE 3 4 * GG EE 4 5 * GG EE 5 6 * GG EE 6 7 * GG EE 7 8 * GG EE 8 9 * GG EE 9 0 l * EE _ 1 * GG
 * Count up in base 10

FF _ * l AA FF * * r *

GG _ * r HH GG * * r *

HH _ * * halt HH * * * FF

Addition of Base-10 Signed Integers
20 state - 13 color 0 * * * A A _ * l B A - * r AAA A * * r * B 0 9 l * B 9 8 r C B 8 7 r C B 7 6 r C B 6 5 r C B 5 4 r C B 4 3 r C B 3 2 r C B 2 1 r C B 1 0 r C B _ * r AA B * * * AA C _ * r D C * * r * D _ * l E D - * r AAAA D * * r * E 0 1 l F E 1 2 l F E 2 3 l F E 3 4 l F E 4 5 l F E 5 6 l F E 6 7 l F E 7 8 l F E 8 9 l F E 9 0 l * E _ * r SHIFT1 E M * r SHIFT1 F _ * l B F * * l * AA _ * r BB AA * _ r * BB M - * halt BB * * * halt SHIFT1 0 1 r SHIFT0 SHIFT0 0 0 r SHIFT0 SHIFT0 _ 0 * F AAA 0 9 l * AAA 9 8 r BBB AAA 8 7 r BBB AAA 7 6 r BBB AAA 6 5 r BBB AAA 5 4 r BBB AAA 4 3 r BBB AAA 3 2 r BBB AAA 2 1 r BBB AAA 1 0 r BBB AAA _ * r BB AAA * * * BB BBB _ * r CCC BBB * * r * CCC _ * l DDD CCC - * * AAAAA CCC * * r * DDD 9 8 l EEE DDD 8 7 l EEE DDD 7 6 l EEE DDD 6 5 l EEE DDD 5 4 l EEE DDD 4 3 l EEE DDD 3 2 l EEE DDD 2 1 l EEE DDD 1 0 l EEE DDD 0 9 l * DDD _ * r FFF EEE _ * l * EEE * * * AAA FFF _ * * GGG FFF * _ r * GGG _ * l * GGG * * * HHH HHH 0 1 * halt HHH 1 2 * halt HHH 2 3 * halt HHH 3 4 * halt HHH 4 5 * halt HHH 5 6 * halt HHH 6 7 * halt HHH 7 8 * halt HHH 8 9 * halt HHH 9 0 l * AAAA _ * l BBBB AAAA * * r * BBBB 9 8 l F BBBB 8 7 l F BBBB 7 6 l F BBBB 6 5 l F BBBB 5 4 l F BBBB 4 3 l F BBBB 3 2 l F BBBB 2 1 l F BBBB 1 0 l F BBBB 0 9 l * BBBB * * * FFF AAAAA * M r E
 * Start in state A
 * State A- find right end of left block, detect sign
 * State B- decrement left block, detect if calculations are complete
 * States C and D- find right end of right block, check sign on right block
 * State E- increment right block, shifting to the right if needed
 * State F- return to right end of left block
 * States AA and BB- calculations are finished, clean up and halt
 * States SHIFT1 and SHIFT0- shift right block 1 cell to the right
 * State AAA- Left block is negative, increment left block towards 0 and detect if finished
 * States BBB and CCC- Find right end of right block, check sign on right block
 * State DDD- Decrement right block, detect if finished
 * State EEE- Return to right end of left block
 * State FFF- Cleanup
 * State GGG- Return to right end of left block
 * State HHH- finish calculations and halt
 * States AAAA and BBBB- Right block is negative, respond accordingly
 * State AAAAA- Both blocks are negative, respond accordingly