PenisScript

From Esolang
(Redirected from Penisscript)
Jump to navigation Jump to search

PenisScript is a joke esoteric programming language created by Lleyton. It is identical to Brainfuck, except that the instructions are changed into ASCII penises. It is one of a thousand poorly written Brainfuck translations made as a joke. Because of this, it falls under the TrivialBrainfuckSubstitution family of programming languages. Also note that the file extension is .pp, which shows the author's poor sense of humor.

Commands

Brainfuck PenisScript Description
> 8=D Move the pointer to the right
< 8==D Move the pointer to the left
+ 8===D Increment the memory cell under the pointer
- 8====D Decrement the memory cell under the pointer
. 8=====D Output the character signified by the cell at the pointer
, 8======D Input a character and store it in the cell at the pointer
[ 8=======D Jump past the matching 8========D if the cell under the pointer is 0
] 8========D Jump back to the matching 8=======D

Hello, world! program

8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8=======D8=D8===D8===D8===D8===D8===D8===D8===D8=D8===D
8===D8===D8===D8===D8===D8===D8===D8===D8===D8=D8===D8===D8===D8=D8===D8==D8==D8==D8==D8====D8========D8=D8===D
8===D8=====D8=D8===D8=====D8===D8===D8===D8===D8===D8===D8===D8=====D8=====D8===D8===D8===D8=====D8=D8===D8===D
8=====D8==D8==D8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8===D8=====D8=D8=====D8===D
8===D8===D8=====D8====D8====D8====D8====D8====D8====D8=====D8====D8====D8====D8====D8====D8====D8====D8====D
8=====D8=D8===D8=====D8=D8=====D

Interpreter

#!/usr/bin/ruby
eval 'm=Hash.new(p=0);'+ARGF.read.gsub(
       /8=+D|./,
       '8=D'=>'p+=1;',
       '8==D'=>'p-=1;',
       '8===D'=>'m[p]+=1;',
       '8====D'=>'m[p]-=1;',
       '8=====D'=>'putc m[p];',
       '8======D'=>'m[p]=STDIN.getbyte if !STDIN.eof;',
       '8=======D'=>'(',
       '8========D'=>')while((m[p]&=255)!=0);')

See also

External resources