Nopfunge Solid

Nopfunge Solid is a simplification of Nopfunge (designed by Hubert Lamontagne in 2015), invented by Keymaker in 2023.

Language description

Unlike in Nopfunge, in Nopfunge Solid the program contains no sections. The program is simpler; there are no repeating top and left border sections. There is only one two-dimensional playfield (of any positive non-zero integer width and height) which repeats/tiles infinitely to right and down as the pointer moves across it.

Executing one cycle of the program consists of seeing if the current cell (where the pointer is at) has an arrow (>v<^), and if it has, altering the pointer's direction according to it. If the cell is space ( ), the direction stays as it is. After the potential direction change, the pointer is moved one step into its direction. On every cycle the pointer moves to another location, it never stays in the same cell.

The pointer begins in location 0,0 (the leftmost, topmost cell) of the 0,0-copy, its direction 'right'. The pointer will move from one copy to another, for example from the rightmost column of the current copy into the leftmost column of the copy on the right. The exception, which is what enables Nopfunge Solid, is the behaviour of the pointer when moving up on the topmost row of the topmost copies, or moving left on the leftmost column of the leftmost copies. In original Nopfunge, in these situations the pointer would move into the other sections. In Nopfunge Solid, which has no other sections, trying to move up on the topmost row in the topmost copies causes the direction to be set to 'right' and the pointer is moved one step right. If trying to go left on the leftmost column of the leftmost copies, the pointer is set to 'down' and it is moved one step down.

The program never halts, but interpreters may have instruction extensions. My interpreter will immediately halt if the pointer detects a period (.) in the cell instead of arrow or space.

Computational class

The language is Turing-complete, proven via Minsky Machine translation. There is a translator at the bottom of the page.

Example translation

Here is a simple Minsky Machine program. It uses registers A and B, which in translation are x-axis and y-axis respectively (in terms of copies).

1 inc A 2
2 inc A 3
3 dec A 4 6
4 inc B 5
5 inc B 3
6 dec B 7 7
7 halt

The translator creates this output. My translation method does not strive for maximum space-saving but for clarity and ease of implementation for myself, who had to write the programs. The translation uses the . extension for halting but creates an infinite loop around it for the sake of implementations that do not support the extension.

v                 v          
> v                   <      
     v                 <     
        v               <    
           v             <   
              v           <  
                 v         < 
                    v       <
 v>                          
 >                     ^     
                             
    v>                       
    >                   ^    
                             
        <v                   
         >               ^   
>                          ^ 
                             
          >               ^  
          v<                 
                             
             >          ^    
             v<              
                ^<           
                >           ^
                  >         ^
                    v        
                    .        
                    ^        

The MM program halts with A=0 and B=3. The Nopfunge Solid program halts with area-x=0 and area-y=3. (If the interpreter does not support the halting extension, it will remain in infinite loop which will be easy to detect.)

Further minimalization

As I was working on Nopfunge Solid, I realized it could be minimized further, but the nature of the language would change somewhat. Because I wanted Nopfunge Solid to retain the simplicity and charasteristics of the original Nopfunge, I made the further simplification into another language and kept Nopfunge Solid as it is. The other language is Turnfunge. See the Esowiki page for more details.

Interpreter and translator

nfsolid.py - A Nopfunge Solid interpreter written in Python. Could be clearer and smaller. Too bad it is a non-visual program; maybe one day I will make one. The interpreter reports the location of the pointer at the end of every cycle, after the instruction pointer has moved.

mmtonfsolid.py - A translator that translates a 2-register Minsky Machine program into a Nopfunge Solid program.

-- Keymaker, 30.3.2023