All pastes #158164 Raw Edit

pikhq

public text v1 · immutable
·published 2006-09-01 23:57 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) {
	>>>>+<<<< temp2=1
	[->>+>+<<<]>>[-<<+>>] temp1=opcode
	>#-------------------------------------------<[-]>[<+>[-]]+<[>-<-]>[ if(temp1 == plus) {
		<<, i=getchar;
		[ while(i!=0) {
			>>>[-]<<<
			- i = i minus 1
			>[-]+++++++++++++++++++++++++++++++++++++++++++. putchar(plus)
		<}]
		>>[-] temp1=0
	}]
        <<<[->>+>+<<<]>>[-<<+>>] 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=0
	}]
        <<<[->>+>+<<<]>>[-<<+>>] temp1=opcode
	>#--------------------------------------------------------------<[-]>[<+>[-]]+<[>-<-]>[ if(temp1== greater than) {
		<<, i=getchar;
		[ while(i!=0) {
                        >>>[-]<<<
			- i = i minus 1
			>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++. putchar(greater than)
		<}]
		>>[-] temp1=0
	}]
	>#[ if(temp2!=0) {
		<<<<. putchar(opcode)
		>>>>- temp2=0
	}]
	[-]<[-]<[-]<[-]<[-] blank all memory
	, opcode=getchar()
]