Forgot what that stands for. pifuck?
- All of standard input is read before starting the program.
- Bijective encoding
- Translate to base-pi
- Input is in register 0
A register contains a string, initially empty
- Register 0: input register, filled with digits 0..3 (base-pi representation of input).
- Register 1: output register, writing to this register will end the program and go to the output stage. Contains pseudo-digits 0..3 (only the low 2 bits will be considered when converting from base-e to a number to output).
- The program may use any number of auxiliary registers numbered 2 and up.
There is one flag bit, set to 1 whenever a replacement is made. It is cleared by conditional GOTO.
Each command-line argument to the interpreter is one adjustment in the program, numbered accordingly (1-based indexing).
-
Find/replace adjustment:
I/pat/repl/O
Replacepat
withrepl
everywhere it appears in input registerI
, writing the output into registerO
. If a replacement is made, set the flag. -
Unconditional GOTO:
I/
(I
> 0) Jump to adjustment indexI
. -
Conditional GOTO:
-I/
(I
> 0) Jump to adjustment indexI
if the flag is set.
- The adjusted output is stored in register 1
- Translate from base-e
- Bijective decoding
- Output to stdout
./pf 0/0/20birthday21repatriate02draft20200flammulatedThraxerythrean020depth00/1 </dev/null
Or e.g.
echo | ./pf 0/100/20birthday21repatriate02draft20200flammulatedThraxerythrean020depth00/1
The example program(s) were generated with the help of the conversion program:
echo "Hello world!" | ./conv
Run make
to build pf
(the interpreter) and conv
(the string converter).
Requires libmpfr and libgmp and their development headers.
This software is licensed under the MIT license. See the LICENSE file.