Search code examples
loopsnested-loopsturing-complete

Simple vs. Nested


Are simple loops as powerful as nested loops in terms of Turing completeness?


Solution

  • In terms of Turing completeness, yes they are.

    Proof: It's possible to write a Brainf*** interpreter using a simple loop, for example here:

    http://www.hevanet.com/cristofd/brainfuck/sbi.c