All pastes #1518827 Raw Edit

ksh93 brainfuck

public shellscript v1 · immutable
#1518827 ·published 2009-08-05 06:10 UTC
rendered paste body
cat <<EOFfunction pc # putchar{	typeset x	x=\$(printf "%x\n" "\$1")	printf "\u[\${x}]"}function gc # getchar{	nameref x="\$1"	typeset c	if read -N1 c ; then		(( x='\${c} ))	else		(( x=-1 )) # EOF	fi}set -o noglobIFS=''integer -a tinteger p(( p= 2**16 )) # tape start positionEOFwhile read -N1 c ; do	case "$c" in		'>') print '(( ++p ))' ;;		'<') print '(( --p ))' ;;		'+') print '(( ++t[p] ))' ;;		'-') print '(( --t[p] ))' ;;		'.') print 'pc ${t[p]}' ;;		',') print 'gc   t[p]' ;;		'[') print 'while (( t[p] != 0 )) ; do' ;;		']') print 'done' ;;	esacdone