We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Brainfuck/Esointerpreters

From Esolang
Jump to navigation Jump to search
This list is currently incomplete, please help add on anything that belongs.

This page contains brainfuck interpreters in other esolangs.

Standard

Countable

Change register 2 to the appropriate tape size needed. This example uses a tape with five cells. A colon following the program determines the input.

0+15 // builder
1+15 // program end location
2+5 // tape length sub one (adjust as needed)
3+0  // program position pointer
4+0  // new program position pointer
5+0  // tape position pointer
6+0  // new tape position pointer
7+0  // decrement flag pointer
8+13 // loop validator pointer (left end)
9+14 // loop validator pointer (right end)
10+0 // new cell value
11+0 // tape pointer
12+0 // tape replicator

// + 43
// - 45
// > 62
// < 60
// . 46
// , 44
// [ 91
// ] 93

a8+1  // initialize both with 1 to prevent edge case
a9+1

∞*1< // escape hatch
  0*1< // read program
    58*1< // use colon for input
      *∞<
        a0@  // get character
        256*1< // switch case
          91*1< 93*1<
            aa0& // go to case (or exit if null)
            256& // skip if none matched
          > // case 93 ']'
            0*1< // exit
              aa8*1<
                256*1< 91*1< // safe guarding
                  aa9& // check if left end == right end
                > >
                a9+1  // right end is lower than left end; loops are balanced thus far
                0&    // skip failure case
              >
              a9+1 // right end is equal to left end; loops are unbalanced
              ∞&   // force exit
            >
            256& // skip next case
          > // case 91 '['
            a8+1  // increase left end
            256& // skip next case
        >
        0+1  // next character
        1+1  // increase length
      >
    >
  >
>
0+1 // final padding

∞*1<
  aa8*1< // check loop balance
    aa9&
    ∞& // unbalanced; program is invalid
  >
  
  // initialization
  3+a0 a3+15 0+1
  4+a0 0+1
  5+a0 0+1
  6+a0 0+1
  7+a0 0+1
  a0*1< *∞<
    a8&
    8+1
  > > 0+1
  a0*1< *∞<
    a9&
    9+1
  > > 0+1
  10+a0 0+1
  11+a0 12+a0
  0+a2 0+1
  
  0*∞<
    11+aa5 // move pointer to cell
    ∞*1<
      43*1< 45*1< 62*1< 60*1< 46*1< 44*1< 91*1< 93*1< // commands
        aaa3& // switch case
        // default case
        a4+aa3 a4+1
        a6+aa5
        a10+aa11
        ∞&  // skip
      > // case 93 ']'
        a6+aa5
        a10+aa11
        *aa11< // check if > 0
          4+10 4+a2 // initialize
          7+6 7+a2  // initialize
          a0+aa3 // initialize
          a8+1 a9+1 // prevent edge case
          ∞*1<
            *∞< // seek to start of loop
              1*aa0< // decrement
                *aa7<
                  a4+1
                  1&
                >
                a7+1
              >
              256*1< // switch case
                93*1< 91*1<
                  43*1< 45*1< 62*1< 60*1< 46*1< 44*1< // safety
                    aaa4& // go to case
                  > > > > > >
                  256& // skip if none matched
                > // case 91 '['
                  0*1< // exit
                    aa8*1<
                      256*1< 93*1< // safe guarding
                        aa9& // check if left end == right end
                      > >
                      a9+1  // right end is lower than left end; haven't met end of loop
                      0&    // skip failure case
                    >
                    a9+1 // right end is equal to left end; met end of loop
                    ∞&   // force exit
                  >
                  256& // skip next case
                > // case 93 ']'
                  a8+1  // increase left end
                  256& // skip next case
              >
              0+2 4+2 7+2 // go to next iteration
            >
          >
          0+3 // skip to empty space
          ∞& // break
        >
        a4+aa3 a4+1 // next command otherwise
        ∞& // break
      > // case 91 '['
        a4+aa3
        a6+aa5
        a10+aa11
        *aa11< // check if > 0
          a4+1 // next command
          ∞&   // break
        >
        ∞*1< // seek to end of loop
          a8+1 a9+1 // prevent edge case
          *∞<
            a4+1
            256*1< // switch case
              91*1< 93*1<
                43*1< 45*1< 64*1< 60*1< 46*1< 44*1< // safety
                  aaa4& // go to case
                > > > > > >
                256& // skip if none matched
              > // case 93 ']'
                0*1< // exit
                  aa8*1<
                    256*1< 91*1< // safe guarding
                      aa9& // check if left end == right end
                    > >
                    a9+1  // right end is lower than left end; haven't met end of loop
                    0&    // skip failure case
                  >
                  a9+1 // right end is equal to left end; met end of loop
                  ∞&   // force exit
                >
                256& // skip next case
              > // case 91 '['
                a8+1  // increase left end
                256& // skip next case
            >
          >
        >
        ∞& // break
      > // case 44 ','
        a4+aa3 a4+1
        a6+aa5
        a10@ // get input
        ∞&   // break
      > // case 46 '.'
        a4+aa3 a4+1
        a6+aa5
        a10+aa11
        %aa11 // print
        ∞&    // break
      > // case 60 '<'
        a4+aa3 a4+1
        a10+aa11
        *aa4< // check if > 0
          1*aa4< // decrement
            *aa7<
              a5+1
              1&
            >
            a7+1
          >
          ∞& // break
        >
        a5+a2 // wraparound otherwise
        ∞& // break
      > // case 62 '>'
        a4+aa3 a4+1
        a10+aa11
        a2*1< // check if at end of tape
          0*1< 45*1< 43*1< // safeguarding
            aa5&
          > > >
          a6+aa5 a6+1 // not at end; no wraparound
        >
        
        ∞& // break
      > // case 45 '-'
        a4+aa3 a4+1
        a6+aa5
        *aa11< // check if > 0
          1*aa11< // decrement
            *aa7<
              a10+1
              1&
            >
            a7+1
          >
          ∞& // break
        >
        a10+255 // wraparound otherwise
        ∞& // break
      > // case 43 '+'
        a4+aa3 a4+1
        a6+aa5
        255*1< // check if == 255
          0*1< // safeguarding
            aa11&
          >
          a10+aa11 a10+1 // not 255; no wraparound
        >
    >

    a0+aa4 // set new program position
    a0*1< *∞<
      a3&
      3+1
    > > 0+1
    a0*1< *∞<
      a4&
      4+1
    > > 0+1
    a0+aa6 // set new tape position
    a0*1< *∞<
      a5&
      5+1
    > > 0+1
    a0*1< *∞<
      a6&
      6+1
    > > 0+1
    a0*1< *∞<
      a7&
      7+1
    > > 0+1
    a0*1< *∞<
      a8&
      8+1
    > > 0+1
    a0*1< *∞<
      a9&
      9+1
    > > 0+2
    *a2< // copy tape
      0*1<
        a11*1< // check if current cell is selected for copying behavior
          a12&
          a0+aa12
          0&
        >
        a0+aa10
      >
      12+1
      0+1
    >
    0*1<
      a11*1< // check if current cell is selected for copying behavior
        a12&
        a0+aa12
        0&
      >
      a0+aa10
    >
    12+1
    0+1
    a9*1< *∞<
      a10&
      10+1
    > > 10+1
    a10*1< *∞<
      a11&
      11+1
    > > 11+1
    a11*1< *∞<
      a12&
      12+1
    > >

    a1*1< // check if at end of program
      aa3&
      0& // continue if not
    >
    ∞& // done
  >
>

Exechars

(2b+1v)(2d-1v)(2ci1v)(2eo1v)(3e-1)(3c+1?1=0-1)(5b?1v=0/0)(0?5v=6-4?5v=7+4+5?0<4/0)(5d?1v!0/1)(1+4/2)(2-5?5v=6+4?5v=7-4?0<4/2)(3i5v?5v!8/4?5v=8/6)(4?5v=9/6+5/3)(6r5v-5rc+5/7)
(7^5v>0*0>a?5v=8t0?5v=9t0/av+1v-1v?1v<0/5?b<1v/8+5/7)(5r100+1v)(8^1v>0*0>arav-1v)+0-0-1+4-4rc+5r5d+6r5b+7rffff+8r21+9rff+b/3t

(Cells wrap at 256, tape is infinite in one direction, using < at cell 0 does nothing, enter the code as ASCII values separated by commas, input is the "code" after a !)
(Remove the newline when actually running)

Fueue

This interpreter simulates 8-bit cells, and makes no attempt to prepare for I/O characters larger than 255 if you should get a Fueue interpreter which takes Unicode seriously. It will treat input characters ≤0 all the same, and assumes EOF has this form, which I think so far only applies to the C interpreter. However it also supports the common ! convention for ending the code, thus allowing the brainfuck program to get input.

):[)~$)[[)[~~~~()+1])][0]$%~~1)][[)~<[)$%+-~)~~~43[)[~:~~~)<[)~~[)$--1[)~]<~~<)<[)$$7--1]][~~~)%[~~)~:(+-
)(~)+-1*256]+-~)255:]~]]!]~][)~<[)$%+-~)~~~45[)[~:~~~)<[)~~[)$--1[)~]<~~<)<[)$$6-%0]][~~~)*[)~(:+~~-)+1]-
--256%):]~]]!]~][)~<[)$%+-~)~~~62[)[~:~~~)<[)~~[)$--1[)~]<~~<)<[)$--%0]][))(($3~)<(]~]]!]~][)~<[)$%+-~)~~
~60[)[~:~~~)<[)~~[)$--1[)~]<~~<)<[)$--%0]][~~)<~~~(]~]]!]~][)~<[)$%+-~)~~~91[)[)~~[)~<[<<<~(~~~<)~][)[))$
12~[:]<<$4~~~<[)$--1[$8~)$4<[)$$6-%0[)]]<]~)~:~]~[!~)~~[)[)$--1[)~~~[)$4~[~):~~[~:~)~[)$$6-%0~~[$~])~]<~]
<~<]$3~[)$~~~%~~)]<~(~~<]~~<<~[0]]<<<:]]]<<[1)]])(~~)~]~~]<~[[~)~~!]):]]!]~][)~<[)$%+-~)~~~93[)[[85 110
109 97 116 99 104 101 100 32 93 46H][)~[))$11~<<~:(~:<]]~)~~~]!]~][)~<[)$%+-~)~~~46[)[~:~~~)<[)~~[)$--1[)
~]<~~<)<[)$%0]][):]~]]!]~][)~<[)$%+-~)~~~44[)[~:~~~)<[~~~~<)[)))~$([[)[~~~~()+1])][0]$%~~1)][)[)[~[0]~])]
[~!]]]~]]!]~][)~<[)$%+-~)~~~33[)[[)~[)[H]]~!][85 110 109 97 116 99 104 101 100 32 91 46H]~)~~~]!]~][)~<[)
$%+-~)~~~0[)[[)~[)[H]]~!][85 110 109 97 116 99 104 101 100 32 91 46H]~)~~~]!]~][)[~:)~]!]:]:]:]:]:]:]:]:]
:]:][0]~]][[0]:[[0]<:[[0]<:]][73 110 116 101 114 110 97 108 32 101 114 114 111 114 58 32 116 111 112 108
101 118 101 108 32 114 117 110 116 105 109 101 32 93 46H])~!][~)]

Funciton

Funciton/Brainfuckiton

Glass

{B[(c__)k<1>=j<1>=u<0>=][(af)/kkB!(_e)$(_e)*kv.?\k*][(ae)/jjB
!(_e)$(_e)*jw.?\j*][pu*][wk1=,][vj1=,][qu1=,]}{C[(c__)aA!iI!o
O!sS!r""(_f)ic.?=(_d)ie.?<0>ae.?=/(_d)(_f)*sa.?(_f)ic.?=(_d)i
e.?<0>ae.?=(_g)(_d)*=/(_g)(_d)(_f)*";"se.?<0>ae.?=(_g)<0>=\\=
tr*sl.?=b<0>=h$gB!][(ai)gp.?<1>as.?(_a)1<-1>ae.?=/(_a),<255>
(_a)<0>=\gq.?][(ah)(_a)b*t*a(lt).?=/(_a)h(ag).?b0*<1>a0.?=
(_a)b*t*a(lt).?=\][(ag)(_b)r*b*si.?=(_a)(_b)*"+"se.?=/(_a)h
(ad).?^\(_a)(_b)*"-"se.?=/(_a)h(ai).?^\(_a)(_b)*">"se.?=/(_a)
hy.?^\(_a)(_b)*"<"se.?=/(_a)hz.?^\(_a)(_b)*"["se.?=/(_a)h(ab)
.?^\(_a)(_b)*"]"se.?=/(_a)h(aa).?^\(_a)(_b)*"."se.?=/(_a)hx.?
^\(_a)(_b)*","se.?=/(_a)h(ac).?^\][(ad)gp.?<1>a0.?<256>a(mod)
.?gq.?][(ac)ic.?(_h)ie.?=/(_h)<0>gq.?,^\s(sn).?gq.?][(ab)(_a)
gp.?=/(_a)^\(_c)<1>=/(_c)b0*<1>a0.?=(_a)b*t*a(gt).?=/(_a)^\
(_b)r*b*si.?=(_a)(_b)*"["se.?=/(_a)(_c)0*<1>a0.?=(_a)<0>=\
(_a)(_b)*"]"se.?=/(_a)(_c)0*<1>as.?=(_a)<0>=\\][(aa)(_a)gp.?
<0>ae.?=/(_a)^\(_c)<1>=/(_c)b0*<1>as.?=(_a)b*<0>a(le).?=
/(_a)^\(_b)r*b*si.?=(_a)(_b)*"["se.?=/(_a)(_c)0*<1>as.?=(_a)
<0>=\(_a)(_b)*"]"se.?=/(_a)(_c)0*<1>a0.?=(_a)<0>=\\][zg(af).
?g1=,][yg(ae).?g1=,][xgp.?s(ns).?o0.?]}{M[m(_i)C!(_i)(ah).?]
}

Kawa

Raw text version at Kawa/Raw programs#brainfuck implementation

MoreMathRPN

MoreMathRPN/Brainfuck_interpreter

Piet

here

Readable

−−−−−--−−---−−                                                     | Set(2,5) # Mem layout: TMP IP MP SP CODE1 MEM1 CODE2 MEM2 ...
−-−---−−---−−−−---------−−                                         | While(Get(1)-33) # Populate the cells with input characters
−−−−−−----                                                         | 	Set(1,Inc())
−−−−---−−--−---−−−                                                 | 	Set(Get(2),Get(1))
−−−−−--−--−----−−--−−--−                                           | 	Set(2,Get(2)+2)
−--−                                                               | End()
−−−−−--−−---−−                                                     | Set(2,5)
−−−−−-−−−-−--−                                                     | Set(3,6)
−−−−−−−−                                                           | Set(1,1)
−-−----−−−                                                         | While(Get(1)) # Code execution
−-----−−---−---−−--−−---−---−-−−                                   | 	If(Get(Get(2))-43) # +
−-----−−---−---−−--−−---−-−---−−                                   | 		If(Get(Get(2))-45) # -
−-----−−---−---−−--−−---−-−----−                                   | 			If(Get(Get(2))-44) # ,
−-----−−---−---−−--−−---−-−-−--−                                   | 				If(Get(Get(2))-46) # .
−-----−−---−---−−--−−-−-−-−----−                                   | 					If(Get(Get(2))-60) # <
−-----−−---−---−−--−−-−-−-−-−--−                                   | 						If(Get(Get(2))-62) # >
−-----−−---−---−−--−−---−-−---−-−−                                 | 							If(Get(Get(2))-91) # [
−-----−−---−---−−--−−---−-−-−---−−                                 | 								If(Get(Get(2))-93) # ]
−-----−−---−---−−--−−---------−−                                   | 									If(Get(Get(2))-33) # ! (Terminator)
−-−−                                                               | 									Else()
−−−−−−--−−−−−−                                                     | 									Set(1,0)
−--−                                                               | 									End()
−-−−                                                               | 								Else()
−------−---−−-−−                                                   | 									If(Get(Get(3)))
−−−−−----−−−                                                       | 										Set(4,1)
−−−−−--−--−−---−−--−−--−                                           | 										Set(2,Get(2)-2)
−-−----−−----−                                                     | 										While(Get(4))
−-----−−---−---−−--−−---−-−---−-−−                                 | 											If(Get(Get(2))-91)
−-----−−---−---−−--−−---−-−-−---−−                                 | 												If(Get(Get(2))-93)
−-−−                                                               | 												Else()
−−−−−----−--−----−−----−−−                                         | 													Set(4,Get(4)+1)
−--−                                                               | 												End()
−-−−                                                               | 											Else()
−−−−−----−--−−---−−----−−−                                         | 												Set(4,Get(4)-1)
−--−                                                               | 											End()
−−−−−--−--−−---−−--−−--−                                           | 											Set(2,Get(2)-2)
−--−                                                               | 										End()
−--−                                                               | 									End()
−--−                                                               | 								End()
−-−−                                                               | 							Else()
−------−---−−-−−                                                   | 								If(Get(Get(3)))
−-−−                                                               | 								Else()
−−−−−----−−−                                                       | 									Set(4,1)
−−−−−--−--−----−−--−−--−                                           | 									Set(2,Get(2)+2)
−-−----−−----−                                                     | 									While(Get(4))
−-----−−---−---−−--−−---−-−---−-−−                                 | 										If(Get(Get(2))-91)
−-----−−---−---−−--−−---−-−-−---−−                                 | 											If(Get(Get(2))-93)
−-−−                                                               | 											Else()
−−−−−----−--−−---−−----−−−                                         | 												Set(4,Get(4)-1)
−--−                                                               | 											End()
−-−−                                                               | 										Else()
−−−−−----−--−----−−----−−−                                         | 											Set(4,Get(4)+1)
−--−                                                               | 										End()
−−−−−--−--−----−−--−−--−                                           | 										Set(2,Get(2)+2)
−--−                                                               | 									End()
−−−−−--−--−−---−−--−−--−                                           | 									Set(2,Get(2)-2)
−--−                                                               | 								End()
−--−                                                               | 							End()
−-−−                                                               | 						Else()
−−−−−-−−--−----−−-−−−--−                                           | 							Set(3,Get(3)+2)
−--−                                                               | 						End()
−-−−                                                               | 					Else()
−−−−−-−−--−−---−−-−−−--−                                           | 						Set(3,Get(3)-2)
−--−                                                               | 					End()
−-−−                                                               | 				Else()
−−-−---−---−−-−−                                                   | 					Outc(Get(Get(3)))
−--−                                                               | 				End()
−-−−                                                               | 			Else()
−−−−---−−-−−----                                                   | 				Set(Get(3),Inc())
−--−                                                               | 			End()
−-−−                                                               | 		Else()
−−−−---−−-−−-−−---−----−---−−-−−−-−-−-−-−-−-−-−−−----------------− | 			Set(Get(3),(Get(Get(3))+255)%256)
−--−                                                               | 		End()
−-−−                                                               | 	Else()
−−−−---−−-−−-−−---−----−---−−-−−−−−----------------−               | 		Set(Get(3),(Get(Get(3))+1)%256)
−--−                                                               | 	End()
−−−−−--−--−----−−--−−--−                                           | 	Set(2,Get(2)+2)
−--−                                                               | End()

Without comments:

−−−−−--−−---−−−-−---−−---−−−−---------−−−−−−−−----−−−−---−−--−---−−−−−−−−--−--−----−−--−−--−−--−−−−−−--−−---−−−−−−−-−−−-−--−−−−−−−−−−-−----−−−−-----−−---−---−−--−−---−---−-−−−-----−−---−---−−--−−---−-−---−−−-----−−---−---−−--−−---−-−----−−-----−−---−---−−--−−---−-−-−--−−-----−−---−---−−--−−-−-−-−----−−-----−−---−---−−--−−-−-−-−-−--−−-----−−---−---−−--−−---−-−---−-−−−-----−−---−---−−--−−---−-−-−---−−−-----−−---−---−−--−−---------−−−-−−−−−−−−--−−−−−−−--−−-−−−------−---−−-−−−−−−−----−−−−−−−−--−--−−---−−--−−--−−-−----−−----−−-----−−---−---−−--−−---−-−---−-−−−-----−−---−---−−--−−---−-−-−---−−−-−−−−−−−----−--−----−−----−−−−--−−-−−−−−−−----−--−−---−−----−−−−--−−−−−−--−--−−---−−--−−--−−--−−--−−--−−-−−−------−---−−-−−−-−−−−−−−----−−−−−−−−--−--−----−−--−−--−−-−----−−----−−-----−−---−---−−--−−---−-−---−-−−−-----−−---−---−−--−−---−-−-−---−−−-−−−−−−−----−--−−---−−----−−−−--−−-−−−−−−−----−--−----−−----−−−−--−−−−−−--−--−----−−--−−--−−--−−−−−−--−--−−---−−--−−--−−--−−--−−-−−−−−−−-−−--−----−−-−−−--−−--−−-−−−−−−−-−−--−−---−−-−−−--−−--−−-−−−−-−---−---−−-−−−--−−-−−−−−−---−−-−−----−--−−-−−−−−−---−−-−−-−−---−----−---−−-−−−-−-−-−-−-−-−-−−−----------------−−--−−-−−−−−−---−−-−−-−−---−----−---−−-−−−−−----------------−−--−−−−−−--−--−----−−--−−--−−--−

Use ! to separate program and input.

Stringle

s "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++."

a " !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~?""
g ":"
@g 255
g "." g

#s 

h .s h
s :s
c "c" #p
f ""
b ""
m ""
.h ">" p p "."
.h "<" p :p
.h "+" *c *c "."
.h "-" *c :*c

.h "." m "o"
m "o" k #*c
m "o" k1 #:::::::::::::::::::::::::::::::*c
m "o" k 10 $ o
m "o" k 10 o ""
m "o" k !10 g1 g
m "o" k !10 #g1 k1
m "o" k !10 g1 g1 "a"
m "o" k !10 o o *g1

.h "," m "i"
m "i" #i 0 i $
m "i" k @i
m "i" i :i
m "i" g1 g
m "i" #g1 k
m "i" *c g1

.h "[" *c "" f "."
#f
#f !0 h .s h
#f !0 s :s
#f !0 .h "[" f f "."
#f !0 .h "]" f :f
#f

.h "]" *c !"" b "."
#b
#b !0 s .h s
#b !0 h :h
#b !0 .h "[" b :b
#b !0 .h "]" b b "."
#b

#s

$ o
o ""

Textile

Textile/brainfuck

Thue

by User:Jan jelo

(input and output are unary numbers(each output wrapped by ( and )),the value of each cell is an unbounded natural number)

{0>}+::=+{0>}
{0>}-::=-{0>}
{0>}<::=<{0>}
{0>}>::=>{0>}
{0>}[::=[{0>}
{0>}]::=]{0>}
{0>}.::=.{0>}
{0>},::=,{0>}
{0>}p+::=p+{+|>}
{0>}p-::=p-{-|>}
{0>}p<::=p<{<|>}
{0>}p>::=p>{>|>}
{0>}p[::=p[{[|>}
{0>}p]::=p]{]|>}
{0>}p.::=p.{.|>}o(o
{0>}p,::=p,{,|>}

{+|>}+::=+{+|>}
{+|>}-::=-{+|>}
{+|>}<::=<{+|>}
{+|>}>::=>{+|>}
{+|>}[::=[{+|>}
{+|>}]::=]{+|>}
{+|>}.::=.{+|>}
{+|>},::=,{+|>}
{+|>}!::=!{+|>}
{+|>}|::=|{+|>}
{+|>}*::=*{+|>}
{+|>}q::={<1}q*

+{<1}::={<1}+
-{<1}::={<1}-
<{<1}::={<1}<
>{<1}::={<1}>
[{<1}::={<1}[
]{<1}::={<1}]
.{<1}::={<1}.
,{<1}::={<1},
!{<1}::={<1}!
|{<1}::={<1}|
*{<1}::={<1}*
p{<1}+::={0>}+p
p{<1}-::={0>}-p
p{<1}<::={0>}<p
p{<1}>::={0>}>p
p{<1}[::={0>}p[
p{<1}]::={0>}p]
p{<1}.::={0>}.p
p{<1},::={0>},p
*q{<1}::=q{<1}*
|q{<1}::=|{<1}q
!q{<1}::=!|q{<1}

{-|>}+::=+{-|>}
{-|>}-::=-{-|>}
{-|>}<::=<{-|>}
{-|>}>::=>{-|>}
{-|>}[::=[{-|>}
{-|>}]::=]{-|>}
{-|>}.::=.{-|>}
{-|>},::=,{-|>}
{-|>}!::=!{-|>}
{-|>}|::=|{-|>}
{-|>}*::=*{-|>}
{-|>}q*::={<1}q
{-|>}q|::={<1}q|
{-|>}q)::={-|>}q|)

{<|>}+::=+{<|>}
{<|>}-::=-{<|>}
{<|>}<::=<{<|>}
{<|>}>::=>{<|>}
{<|>}[::=[{<|>}
{<|>}]::=]{<|>}
{<|>}.::=.{<|>}
{<|>},::=,{<|>}
{<|>}!::=!{<|>}
{<|>}|::=|{<|>}
{<|>}*::=*{<|>}
*{<|>}q::={<|>}q*
|{<|>}q::=q{<1}|
!{<|>}q::=!|{<|>}q

{>|>}+::=+{>|>}
{>|>}-::=-{>|>}
{>|>}<::=<{>|>}
{>|>}>::=>{>|>}
{>|>}[::=[{>|>}
{>|>}]::=]{>|>}
{>|>}.::=.{>|>}
{>|>},::=,{>|>}
{>|>}!::=!{>|>}
{>|>}|::=|{>|>}
{>|>}*::=*{>|>}
{>|>}q*::=*{>|>}q
{>|>}q|::=|{<1}q
{>|>}q)::={>|>}q|)

{[|>}+::=+{[|>}
{[|>}-::=-{[|>}
{[|>}<::=<{[|>}
{[|>}>::=>{[|>}
{[|>}[::=[{[|>}
{[|>}]::=]{[|>}
{[|>}.::=.{[|>}
{[|>},::=,{[|>}
{[|>}!::=!{[|>}
{[|>}|::=|{[|>}
{[|>}*::=*{[|>}
*{[|>}q::={[|>}q*
{[|>}q*::={<|[1}q*
{[|>}q|::={<|[0}q|
{[|>}q)::={[|>}q|)

+{<|[1}::={<|[1}+
-{<|[1}::={<|[1}-
<{<|[1}::={<|[1}<
>{<|[1}::={<|[1}>
[{<|[1}::={<|[1}[
]{<|[1}::={<|[1}]
.{<|[1}::={<|[1}.
,{<|[1}::={<|[1},
!{<|[1}::={<|[1}!
|{<|[1}::={<|[1}|
*{<|[1}::={<|[1}*
p{<|[1}[::=[{0>}p

+{<|[0}::={<|[0}+
-{<|[0}::={<|[0}-
<{<|[0}::={<|[0}<
>{<|[0}::={<|[0}>
[{<|[0}::={<|[0}[
]{<|[0}::={<|[0}]
.{<|[0}::={<|[0}.
,{<|[0}::={<|[0},
!{<|[0}::={<|[0}!
|{<|[0}::={<|[0}|
*{<|[0}::={<|[0}*
p{<|[0}[::=[{<2}p

+{<2}::={<2}+
-{<2}::={<2}-
<{<2}::={<2}<
>{<2}::={<2}>
[{<2}::={<2}[
]{<2}::={<2}]
.{<2}::={<2}.
,{<2}::={<2},
|{<2}::=*|{3>}

{3>}+::=+{3>}
{3>}-::=-{3>}
{3>}<::=<{3>}
{3>}>::=>{3>}
{3>}[::=[{3>}
{3>}]::=]{3>}
{3>}.::=.{3>}
{3>},::=,{3>}
{3>}p+::=+{3>}p
{3>}p-::=-{3>}p
{3>}p<::=<{3>}p
{3>}p>::=>{3>}p
{3>}p[::=[{<2}p
{3>}p]::=]{<4}p
{3>}p.::=.{3>}p
{3>}p,::=,{3>}p

+{<4}::={<4}+
-{<4}::={<4}-
<{<4}::={<4}<
>{<4}::={<4}>
[{<4}::={<4}[
]{<4}::={<4}]
.{<4}::={<4}.
,{<4}::={<4},
**|{<4}::=*|{3>}
(*|{<4}::=(|{0>}

{]|>}+::=+{]|>}
{]|>}-::=-{]|>}
{]|>}<::=<{]|>}
{]|>}>::=>{]|>}
{]|>}[::=[{]|>}
{]|>}]::=]{]|>}
{]|>}.::=.{]|>}
{]|>},::=,{]|>}
{]|>}!::=!{]|>}
{]|>}|::=|{]|>}
{]|>}*::=*{]|>}
*{]|>}q::={]|>}q*
{]|>}q*::={<|]1}q*
{]|>}q|::={<|]0}q|
{]|>}q)::={]|>}q|)

+{<|]1}::={<|]1}+
-{<|]1}::={<|]1}-
<{<|]1}::={<|]1}<
>{<|]1}::={<|]1}>
[{<|]1}::={<|]1}[
]{<|]1}::={<|]1}]
.{<|]1}::={<|]1}.
,{<|]1}::={<|]1},
!{<|]1}::={<|]1}!
|{<|]1}::={<|]1}|
*{<|]1}::={<|]1}*
p{<|]1}]::={<5}p]

+{<|]0}::={<|]0}+
-{<|]0}::={<|]0}-
<{<|]0}::={<|]0}<
>{<|]0}::={<|]0}>
[{<|]0}::={<|]0}[
]{<|]0}::={<|]0}]
.{<|]0}::={<|]0}.
,{<|]0}::={<|]0},
!{<|]0}::={<|]0}!
|{<|]0}::={<|]0}|
*{<|]0}::={<|]0}*
p{<|]0}]::={0>}]p

+{<5}::={<5}+
-{<5}::={<5}-
<{<5}::={<5}<
>{<5}::={<5}>
[{<5}::={<5}[
]{<5}::={<5}]
.{<5}::={<5}.
,{<5}::={<5},
|{<5}::=*|{6>}

{6>}+::=+{6>}
{6>}-::=-{6>}
{6>}<::=<{6>}
{6>}>::=>{6>}
{6>}[::=[{6>}
{6>}]::=]{6>}
{6>}.::=.{6>}
{6>},::=,{6>}
+{6>}p::={6>}p+
-{6>}p::={6>}p-
<{6>}p::={6>}p<
>{6>}p::={6>}p>
[{6>}p::={<7}p[
]{6>}p::={<5}p]
.{6>}p::={6>}p.
,{6>}p::={6>}p,

+{<7}::={<7}+
-{<7}::={<7}-
<{<7}::={<7}<
>{<7}::={<7}>
[{<7}::={<7}[
]{<7}::={<7}]
.{<7}::={<7}.
,{<7}::={<7},
**|{<7}::=*|{6>}
(*|{<7}::=(|{0>}

o*o::=~*
o(o::=~(
o)o::=~)

{.|>}+::=+{.|>}
{.|>}-::=-{.|>}
{.|>}<::=<{.|>}
{.|>}>::=>{.|>}
{.|>}[::=[{.|>}
{.|>}]::=]{.|>}
{.|>}.::=.{.|>}
{.|>},::=,{.|>}
{.|>}!::=!{.|>}
{.|>}|::=|{.|>}
{.|>}*::=*{.|>}
{.|>}q*::=*{.|>}qo*o
{.|>}q|::=qo)o{<1}|
{.|>}q)::={.|>}q|)

i::=:::

{,|>}+::=+{,|>}
{,|>}-::=-{,|>}
{,|>}<::=<{,|>}
{,|>}>::=>{,|>}
{,|>}[::=[{,|>}
{,|>}]::=]{,|>}
{,|>}.::=.{,|>}
{,|>},::=,{,|>}
{,|>}!::=!{,|>}
{,|>}|::=|{,|>}
{,|>}*::=*{,|>}
{,|>}q*::={,|>}q
{,|>}q|::=qi{<1}|
{,|>}q)::={,|>}q|)

PROGRAM::=++++++++[-<+++++++++>]<.

::=

(|{0>}pPROGRAM!q)

Wenyan

吾有一術。名之曰「腦」。欲行是術。必先得二言。曰「代碼」。曰「輸入」。
乃行是術曰。
	吾有一列。名之曰「带」。充「带」以零。
	有數一。名之曰「指針」。
	有數一。名之曰「代碼指針」。
	有數一。名之曰「輸入指針」。
	吾有一言。名之曰「輸出」。
	吾有一言。曰「「\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ」」。名之曰「字表」。
	恆為是。
		若「代碼指針」大於「代碼」之長者。
			乃止。
		云云。
		夫「代碼」之「代碼指針」。名之曰「命令」。
		若「命令」等於「「+」」者。
			夫「带」之「指針」。名之曰「值」。
			加「值」以一。昔之「值」者。今其是矣。
			除「值」以二百五十六。所餘幾何。昔之「带」之「指針」者。今其是矣。
		云云。
		若「命令」等於「「-」」者。
			夫「带」之「指針」。名之曰「值」。
			加「值」以二百五十五。昔之「值」者。今其是矣。
			除「值」以二百五十六。所餘幾何。昔之「带」之「指針」者。今其是矣。
		云云。
		若「命令」等於「「<」」者。
			減「指針」以一。昔之「指針」者。今其是矣。
		云云。
		若「命令」等於「「>」」者。
			加「指針」以一。昔之「指針」者。今其是矣。
			若「指針」大於「带」之長者。
				充「带」以零。
			云云。
		云云。
		若「命令」等於「「.」」者。
			夫「带」之「指針」。名之曰「值」。
			加「值」以一。昔之「值」者。今其是矣。
			夫「字表」之「值」。名之曰「字」。
			加「輸出」以「字」。昔之「輸出」者。今其是矣。
		云云。
		若「命令」等於「「,」」者。
			有數零。名之曰「编碼」。
			若「輸入指針」大於「輸入」之長者。
				昔之「带」之「指針」者。今零是矣。
			若非。
				夫「輸入」之「輸入指針」。名之曰「輸入字符」。
				夫「带」之「指針」。
				凡「字表」中之「字」。
					若「字」等於「輸入字符」者。
						乃止。
					云云。
					加「编碼」以一。昔之「编碼」者。今其是矣。
				云云。
				昔之「带」之「指針」者。今「编碼」是矣。
				加「輸入指針」以一。昔之「輸入指針」者。今其是矣。
			云云。
		云云。
		若「命令」等於「「[」」者。
			夫「带」之「指針」。名之曰「值」。
			若「值」等於零者。
				有數一。名之曰「括號」。
				有數零。名之曰「位置」。
				昔之「位置」者。今「代碼指針」是矣。
				恆為是。
					若「括號」等於零者。
						乃止。
					云云。
					加「位置」以一。昔之「位置」者。今其是矣。
					夫「代碼」之「位置」。名之曰「字符」。
					若「字符」等於「「[」」者。
						加「括號」以一。昔之「括號」者。今其是矣。
					云云。
					若「字符」等於「「]」」者。
						減「括號」以一。昔之「括號」者。今其是矣。
					云云。
				云云。
				昔之「代碼指針」者。今「位置」是矣。
			云云。
		云云。
		若「命令」等於「「]」」者。
			夫「带」之「指針」。名之曰「值」。
			若「值」不等於零者。
				有數一。名之曰「括號」。
				有數零。名之曰「位置」。
				昔之「位置」者。今「代碼指針」是矣。
				恆為是。
					若「括號」等於零者。
						乃止。
					云云。
					減「位置」以一。昔之「位置」者。今其是矣。
					夫「代碼」之「位置」。名之曰「字符」。
					若「字符」等於「「]」」者。
						加「括號」以一。昔之「括號」者。今其是矣。
					云云。
					若「字符」等於「「[」」者。
						減「括號」以一。昔之「括號」者。今其是矣。
					云云。
				云云。
				昔之「代碼指針」者。今「位置」是矣。
			云云。
		云云。
		加「代碼指針」以一。昔之「代碼指針」者。今其是矣。
	云云。
	吾有一言。曰「輸出」。書之。
是謂「腦」之術也。
注曰「「輸出輸入」」。
施「腦」於「「,[.,]」」於「「input」」。
注曰「「問天地好在(英文)」」。
施「腦」於「「++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.」」於「「」」。

By User:None1.

Minez

(made by User:Dooblix)

// Brainfuck Interpreter written in Minez
// needs at least ~20 memory cells (ideally: 15+num_of_regs+bf_program_length)
// Memory usage:
//     0: zero comparison
//     1: printing host
//     2: bf program counter
//     3: bf memory pointer
//     4 - 11: bf chars comparison
//     12: 255 constant comparison
//     13: bf program length
//     14: num_of_regs, later: runtime
//     14+num_of_regs: start of brainfuck program
// Index memory usage:
//     0: start of program string


// Initialize brainfuck chars
>4+43>+44>+45>+46>+60>+62>+91>+93>+255
// Take num_of_regs input
>1+69#+41#+6#-15#+13#-82#+68#+1#+14#-10#+9#-13#-1#-68#+78#+7#-8#-11#+3#+13#-82#+79#-9#-70#+82#-13#+2#+2#+10#+1#-15#+13#+1#-83#+8#+77#-12#+5#+6#-75#+17#-26#
>14:
// Make sure at least 1 register is allocated
{14=0}(
    >14+
)
{14<0}(
    >14x+
)

// Allocate memory
@|[->X>|>14-]_->X>|

// Brainfuck program input loop
>1x+69#+41#+6#-15#+13#-82#+34#+48#-17#+8#+5#-8#+15#-18#+8#-75#+80#+2#-3#-8#+11#-17#+12#-51#-26#
>0+10 // NOTE: Change to +13 on Windows!
->>.>|<[->X.>|<{i=0}(>0x~)>13+]X>1x+10#
>14x-R
>13+
[
    ->|>2@[->X>|>2-]x_->X> // go to current char
    // Case '+'
    {i=4}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        {i=12}(
            x // set to zero if 255 to simulate 8-Bit
            >2+~
        )
        + // otherwise just add one
        >2+~
    )
    // Case ','
    {i=5}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        . // take input
        >2+~
    )
    // Case '-'
    {i=6}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        {i=0}(
            +255 // set to 255 if zero to simulate 8-Bit
            >2+~
        )
        -1 // otherwise just subtract one
        >2+~
    )
    // Case '.'
    {i=7}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        # // print char
        >2+~
    )
    // Case '<'
    {i=8}(
        >3
        {i=0}(
            // Error message (pointer < 0)
            >1x+10#+63#+37#-10#+1#+19#-51#+45##-3#+3#-56#-26#+80#-1#-6#+5#+6#-15#+13#-82#+79#+6#-1#-84#+79#-9#-70#+66#+13#+6#-7#-10#+15#-69#-36#-1#+56#+51#-84#+73#+5#+5#+1#-2#+3#-18#+17#-11#+6#-1#-78#+73#+5#-10#+1#+19#-62#-26#>2#!>1-22#-1#+71#+31#-6#+5#+6#-15#+13#-82#+67#-2#+13##+1#+5#-84#+66#+3#-69#+78#-9#+2#-6#+19#-11#+13#-17#-68#
            ;
        )
        -1
        >2+~
    )
    // Case '>'
    {i=9}(
        >3
        {i=14}(
            // Error message (pointer > num_of_regs)
            >1x+10#+63#+37#-10#+1#+19#-51#+45##-3#+3#-56#-26#+80#-1#-6#+5#+6#-15#+13#-82#+79#+6#-1#-84#+79#-9#-70#+66#+13#+6#-7#-10#+15#-69#-36#-1#+56#+51#-84#+73#+5#+5#+1#-2#+3#-18#+17#-11#+6#-1#-78#+73#+5#-10#+1#+19#-62#-26#>2#!-22#-1#+71#+31#-6#+5#+6#-15#+13#-82#+67#-2#+13##+1#+5#-84#+66#+3#-69#+72#+1#-2#+1#-3#+13#-82#+84#-12#-7#+13#-78#+84#-12#-3#-69#+78#+7#-8#-11#+3#+13#-82#+79#-9#-70#+82#-13#+2#+2#+10#+1#-15#+13#+1#-82#
            ;
        )
        +
        >2+~
    )
    // Case '['
    {i=10}(
        >15|>3@[->X>|>3-]x_->X // go to current memory location
        {i>0}(
            >2@+~ // add current pc to stack and continue
        )
        // if i=0 skip this loop
        >1x+13>0+
        [
            >2+
            ->|>2@[->X>|>2-]x_->X> // go to current char
            {i=10}(
                >0+
            )
            {i=11}(
                >0-
            )
            {i=1}(
                // Error message (missing closing bracket)
                >1x+10#+73#+38#-11#+6#-19#+23#-51#+45##-3#+3#-56#-26#+77#-4#+10##-10#+5#-7#-71#+67#+9#+3#+4#-10#+5#-7#-71#+66#+16#-17#+2#+8#-6#+15#-84#+7#+54#-54#+7#-36#-1#+56#+51#-84#+73#+5#+5#+1#-2#+3#-18#+17#-11#+6#-1#-78#+73#+5#-10#+1#+19#-62#-26#>2x_#!
                ;
            )
            >0
        ]
        >0x
        >2+~
    )
    // Case ']'
    {i=11}(
        >2x_~
    )
    >0+10 // NOTE: Change to +13 on Windows!
    {i=0}(
        x~
    )
    >0x>2+
]
>1x+10#+56#+4#-25#+37#+35#-7#+6#-11#+4#-8#-43#-26#
>14+R#!
>1#+77#+6#
;

dbfi derivatives

StegFuck

TernLSB

Factor, Scratch is dumb, BrainZ

Because dbfi is not public domain, these programs are moved here.

Cheating

OutputF

Input
Fuck the input

Opf

ifi

Befunge/index.php

A null character separates program and input.

>~_X

HQ9+B

B

Brainfucking

N

See also