News for hackers. Stuff that matters.
Re:What if we set GPT-4 free in Minecraft? by fardo on Saturday May 27, 2023 @02:59PM (#36097255)
Or create more loops, since for example adding

For (;;) { print(“hahaha you didn’t say the magic word!”); }

In another loop would also prevent termination without program shutdowns.

Re:What if we set GPT-4 free in Minecraft? by deredede on Sunday May 28, 2023 @02:31PM (#36106535)
Don't let weird C syntax choices fool you, this is a while loop, not a for loop.

To clarify, when I said "for loop", I meant what is sometimes called a "counted for loop" (or simply "counted loop"): there is an (maximum, if you allow early exit) iteration count that is computed before executing the loop and can't increase later.

In C syntax, it is for (int i = 0, e = ...; i < e; ++i) { ... } and the body of the loop is not allowed to change the value of either i or e.

Edit: actually I may have been unclear. When I said "for loops are guaranteed to terminate", in the context of the discussion, I meant "if the only kind of loops you allow are (counted) for loops in a language where loop-free expressions are guaranteed to terminate, you get a language where all expressions are guarantee to terminate". So loops can contain other loops, as long as they are all of the "counted for loop" kind.