Skip to main content
added 94 characters in body
Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Charcoal, 28 bytes

≔⁰ηFX²Lθ«§≔θη±§θη≧⁻§θη绬§θη 

Try it online! Link is to verbose version of code. Outputs using Charcoal's default Boolean output, which is - for true and nothing for false. Explanation:

≔⁰η 

Initialise the instruction pointer.

FX²Lθ« 

Loop as many times as there are theoretically possible states.

§≔θη±§θη 

Negate the value at the instruction pointer.

≧⁻§θηη 

Subtract the new value from the instruction pointer. Charcoal's array accesses are cyclic so this automatically emulates Foo's circular tape.

»¬§θη 

At the end of the loop, output whether the program halted.

Charcoal, 28 bytes

≔⁰ηFX²Lθ«§≔θη±§θη≧⁻§θη绬§θη 

Try it online! Link is to verbose version of code. Explanation:

≔⁰η 

Initialise the instruction pointer.

FX²Lθ« 

Loop as many times as there are theoretically possible states.

§≔θη±§θη 

Negate the value at the instruction pointer.

≧⁻§θηη 

Subtract the new value from the instruction pointer. Charcoal's array accesses are cyclic so this automatically emulates Foo's circular tape.

»¬§θη 

At the end of the loop, output whether the program halted.

Charcoal, 28 bytes

≔⁰ηFX²Lθ«§≔θη±§θη≧⁻§θη绬§θη 

Try it online! Link is to verbose version of code. Outputs using Charcoal's default Boolean output, which is - for true and nothing for false. Explanation:

≔⁰η 

Initialise the instruction pointer.

FX²Lθ« 

Loop as many times as there are theoretically possible states.

§≔θη±§θη 

Negate the value at the instruction pointer.

≧⁻§θηη 

Subtract the new value from the instruction pointer. Charcoal's array accesses are cyclic so this automatically emulates Foo's circular tape.

»¬§θη 

At the end of the loop, output whether the program halted.

Source Link
Neil
  • 184.4k
  • 12
  • 76
  • 290

Charcoal, 28 bytes

≔⁰ηFX²Lθ«§≔θη±§θη≧⁻§θη绬§θη 

Try it online! Link is to verbose version of code. Explanation:

≔⁰η 

Initialise the instruction pointer.

FX²Lθ« 

Loop as many times as there are theoretically possible states.

§≔θη±§θη 

Negate the value at the instruction pointer.

≧⁻§θηη 

Subtract the new value from the instruction pointer. Charcoal's array accesses are cyclic so this automatically emulates Foo's circular tape.

»¬§θη 

At the end of the loop, output whether the program halted.