All pastes #158043 Raw Edit

Pikhq

public text v1 · immutable
·published 2006-09-01 22:40 UTC
rendered paste body
[Uncompressor in Brainfuck. Assumes that EOF=0, and cells wrap]
char opcode@0;
char i@1;
char temp0@2;
char temp1@3;
char temp3@4;
,[ while(opcode!=0) {
	>>>>+<<<< temp3=1
	#
	[->>+>+<<<]>>[-<<+>>] temp1=opcode
	>-------------------------------------------<[-]>[<+>[-]]+<[>-<-][ if(temp1 == plus) {
		<<, i=getchar;
		[ while(i!=0) {
			>>>[-]<<<
			- i = i minus 1
			>[-]+++++++++++++++++++++++++++++++++++++++++++. putchar(plus)
		<}]
	}]
        [->>+>+<<<]>>[-<<+>>] temp1=opcode
        >---------------------------------------------<[-]>[<+>[-]]+<[>-<-][ if(temp1 == minus) {
		<<, i=getchar;
		[ while(i!=0) {
                        >>>[-]<<<
			- i = i minus 1
			>[-]+++++++++++++++++++++++++++++++++++++++++++++. putchar(minus)
		<}]
	}]
	>>[-] temp1=0
	<<<[->>+>+<<<]>>[-<<+>>] temp1=opcode
	>------------------------------------------------------------<[-]>[<+>[-]]+<[>-<-][ if(temp1 == less than) {
		<<, i=getchar;
		[ while(i!=0) {
                        >>>[-]<<<
			- i = i minus 1
			>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++. putchar(less than)
		<}]
	}]
        <<<[->>+>+<<<]>>[-<<+>>] temp1=opcode
	>>--------------------------------------------------------------<[-]>[<+>[-]]+<[>-<-][ if(temp1== greater than) {
		<<, i=getchar;
		[ while(i!=0) {
                        >>>[-]<<<
			- i = i minus 1
			>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++. putchar(greater than)
		<}]
	}]
	>>>[ if(temp3!=0) {
		<<<<. putchar(opcode)
		>>>>- temp3=0
		++++++++++++++++++++++++++++++++.
	}]
	#[-]<[-]<[-]<[-]<[-] blank all memory
	, opcode=getchar()
]