Loopnest

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
This is still a work in progress. It may be changed in the future.

Loopnest is a Turning tarpit that can be modeled by an infinitely nested torus-like shape, embedded in 3d euclidean space. The pointer is essentially a particle with an initial velocity; the instructions build the nested structure that the particle will traverse by giving a rotation angle that will rotate the nested loops so that they will align with the pointer's trajectory. The last instruction will be a special one: nest, which will create a subloop, as well as change the velocity of the pointer. The multiples of complete rotations to reach the nest instruction will determine the amount of nested loops created. When the particle reaches a nest instruction it will be taken down into the sub-loop, and then return. The program ends when the pointer completes one cycle of the initial loop.

Initial State

The initial state of the structure can be thought of as a single loop with 4 loops attached to it perpendicularly, similar to the top of a torus if at every 90 degrees there was a special circle slice with instructions written on it. The instructions AND, OR, NOT, and the nest can be inscribed to points along each loop.

Defining Instructions by a Function

If all instructions are rotations, then one available feature is to define them inductively by a function.