Nov 21, 2009
Pages: 1, 2, 3

Brainf*ck - World's Smallest And Hardest Language

free web hosting

Read Latest Entries..: (Post #20) by khalilov on Sep 26 2008, 09:26 PM.
omg lolNice, iam definantly sticking with PHP and java after seeing this XD, please tell me people just use language to have fun and not actually run servies O.o
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & Free Web Hosting > Computers & Tech > Programming > Programming General > Misc. Programming Languages

Brainf*ck - World's Smallest And Hardest Language

qwijibow
Has anyone Ever Programmed In BrainF*ck before ?

its not a *REAL* language in the sence that you would never use it to program anything seriouse.
but it its very interesting in that it is the smallest complete programming language.

in other words, BrainF*ck is Turing Complete !!!

in theory, any function can be written using only 8 commands.
in brainF these commands are...

Command, BrainF Symbol
Input , (comma)
output . (full stop)
Increment + (plus)
Decrement - (minus)
Left Register < (Smaller Than)
Right Register > (bigger than)
While Not Zero [ (open square bracket)
Loop ] (closed square bracket)

all other characters are ignored.

its a very hard language to learn !!!!!
and insane to de-bug.

there are many interpreters out there for those who are interested, ssearch google.

here is an example of a few programs written in Brain****.

a simple hello world porgram
CODE
++++++++[>+++++++++<-]>.
<+++++[>++++++<-]>-.++++
+++..+++.<++++++++[>>++++
<<-]>>.<<++++[>------<-]>.<++
++[>++++++<-]>.+++.------.--------.>+.


a random number generator.
CODE
>>>++[
   <++++++++[
       <[<++>-]>>[>>]+>>+[
           -[->>+<<<[<[<<]<+>]>[>[>>]]]
           <[>>[-]]>[>[-<<]>[<+<]]+<<
       ]<[>+<-]>>-
   ]<.[-]>>
]


this is a brain**** program to generate mandleprot images
CODE
+++++++++++++[->++>>>+++++>++>+<<<<<<]>>>>>++++++>--->>>>>>>>>>+++++++++++++++[[
>>>>>>>>>]+[<<<<<<<<<]>>>>>>>>>-]+[>>>>>>>>[-]>]<<<<<<<<<[<<<<<<<<<]>>>>>>>>[-]+
<<<<<<<+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>>>+>>>>>>>>>>>>>>>>>>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]<[->+<]>>>>>>>>]<<<<<<<[->>>>>>>+<<<<<<<]<+<<<<<<
<<<]>>>>>>>>-<<<<<[-]+<<<]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>>->[>>>
>>>[->>+<<]>>>]<<<<<<<<<[>[-]<->>>>>>>>[-<<<<<<<<+>[<->-<<+>>]<[->+<]>>>>>>>>]<<
<<<<<[->>>>>>>+<<<<<<<]<+<<<<<<<<<]>+++++[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>
+>>>>>>>>>>>>>>>>>>>>>>>>>>>+<<<<<<[<<<<<<<<<]>>>>>>>>>[>>>>>>[-<<<<<<->>>>>>]+<
<<<<<[->>>>>>->>[-<<<<<<<<+>>>>>>>>]<<<<<<<<[->>>>>>>>+<<<<<<<<<<<<<<<<<[<<<<<<<
<<]>>>>[-]+>>>>>[>>>>>>>>>]>+<]]+>>>>>>>>[-<<<<<<<<->>>>>>>>]+<<<<<<<<[->>>>>>>>
-<<[-<<<<<<+>>>>>>]<<<<<<[->>>>>>+<<<<<<<<<<<<<<<[<<<<<<<<<]>>>[-]+>>>>>>[>>>>>>
>>>]>[-]+<]]+>[-<[>>>>>>>>>]<<<<<<<<]>>>>>>>>]<<<<<<<<<[<<<<<<<<<]>>>>[-]<<<++++
+[-[->>>>>>>>>+<<<<<<<<<]>>>>>>>>>]>>>>>->>>>>>>>>>>>>>>>>>>>>>>>>>>-<<<<<<[<<<<
<<<<<]]>>>]

 

 

 


Comment/Reply (w/o sign-up)

lhunath
Very nice, but appearantly these algorythms only work for one specific variable, and they don't allow storage & retreaval of data in memory?
Hmm.. or they do but youave to manually control the pointer and move it around.. Sound pretty tough, even ASM is easier =P

Comment/Reply (w/o sign-up)

qwijibow
QUOTE (lhunath @ Nov 2 2004, 10:44 AM)
Very nice, but appearantly these algorythms only work for one specific variable, and they don't allow storage & retreaval of data in memory?
Hmm.. or they do but youave to manually control the pointer and move it around.. Sound pretty tough, even ASM is easier =P
*


You can use memory, but yes you have to move the pointer around yourself.

for example, here is a program that will ask you to inpput your name, then it will print out your name...
like a "what is your name ?" "Hello Bob" program...
CODE
TODO: output "what is your name?"
Loop round subtracting one untill the current pointer = 0
[-]
move to the next memory cell The first memory cell must be ZERO
>
Loop round accepting input untill the user hits return
The Ascii Code for return is 10
so subtract 10 from each input character so the input loop will exit
,----------[>,----------]
a return character was hit Return to the start of the name by looping back
through the memory cells untill we hit the zero we put in the first cell
<[<]
TODO: output "Hello "
now loop through the name adding 10 to each memory cell
outputting untill we hit the terminating zero
>++++++++++.[>++++++++++.]
done !

 

 

 


Comment/Reply (w/o sign-up)

farrooda
Guys, programming in martian language is easier

Comment/Reply (w/o sign-up)

lhunath
martian language ?

Comment/Reply (w/o sign-up)

qwijibow
QUOTE
programming in martian language is easier


prgraming in any language is easyer.. thats why BrainF*ck is an art form.

Comment/Reply (w/o sign-up)

musichere
LOL this programming language is actually physically scary. I wish I could be as good as this.

I don't understand at all how

>>>++[
<++++++++[
<[<++>-]>>[>>]+>>+[
-[->>+<<<[<[<<]<+>]>[>[>>]]]
<[>>[-]]>[>[-<<]>[<+<]]+<<
]<[>+<-]>>-
]<.[-]>>
]


can be a random number generator. More than More than More than plus plus while not zero?!

Comment/Reply (w/o sign-up)

bbdesign
Um... WOW.... My brain would burst into flames trying to program with that stuff...

Comment/Reply (w/o sign-up)

qwijibow
CODE
>>>++[
<++++++++[
<[<++>-]>>[>>]+>>+[
-[->>+<<<[<[<<]<+>]>[>[>>]]]
<[>>[-]]>[>[-<<]>[<+<]]+<<
]<[>+<-]>>-
]<.[-]>>
]


translates to...

move to current memory address + 3, add 2, while current memory address doesnt equal 0

move to current memory address - 1, add 8, while current memory address doesnt equal 0

move to current memory address - 1, while current memeory address doesnt equal 0
move to current memory address - 1, add 2 ,move to current memory address +1
minus 1, return move to current memory address + 2, while..


well, you get the diea right ?
think of it as machine code wink.gif

Comment/Reply (w/o sign-up)

lhunath
It's actually very easy and simplistic. Just takes a bit more to figure things because it's low level.

Comment/Reply (w/o sign-up)

Latest Entries

khalilov
omg lol
Nice, iam definantly sticking with PHP and java after seeing this XD, please tell me people just use language to have fun and not actually run servies O.o

Comment/Reply (w/o sign-up)

FirefoxRocks
OMG who would seriously try to program in this language? From my perspective, it is something just for messing around with and not for anything serious. Is this even a compiled language? Or is it just interpreted (like JavaScript)?

Something as simple as Hello World is at high difficulty to figure out, imagine trying to program a Snake game or any common desktop application with this language!!

Comment/Reply (w/o sign-up)

DrK3055A
QUOTE(cristofd @ Nov 19 2004, 12:32 PM) *

No games yet. Probably the closest thing is the cellular automaton "life", here:
http://www.df.lth.se/~lft/brain****/

Tic-tac-toe and guess-a-number are on my to-do list, but they've been there a while.

The best general source for brain**** source code is the repository at:
http://esoteric.sange.fi/brain****/

(Fix censoring in both URLs.)

Good luck;
-Daniel Cristofani.


Here is my version of a BrainF*ck compiler for DOS, 114 byte sized:

CODE


                 MOV AH,9h
                 MOV DX,EMPEZAR
                 INT 021h
LEER:
                 MOV AH,8h
                 INT 021h
                 MOV DI,BFLOOP
AUN_NO:          DEC DI
                 CMP B[DI],AL
                 JE IMPRIME
                 CMP B[DI],CH
                 JNE AUN_NO
                 JMP LEER+2
IMPRIME:         MOV DX,DI
                 INC DX
                 PUSH AX
                 MOV AH,9h
                 INT 021h
                 POP AX
                 CMP AL,040h
                 JNE LEER
                 RET

EMPEZAR:         MOV BH,80h
                 MOV CX,BX
                 MOV DI,BX
                 REP STOSB
                 DB '$',0

                 DB '>'
                 INC BX
                 DB '$'
        
                 DB '<'
                 DEC BX
                 DB '$'

                 DB '+'
                 INC B[BX]
                 DB '$'

                 DB '-'
                 DEC B[BX]
                 DB '$'

                 DB '.'
                 MOV AH,2
                 MOV DL,B[BX]
                 INT 021h
                 DB '$'

                 DB ','
                 MOV AH,8
                 INT 021h
                 MOV B[BX],AL
                 DB '$'

                 DB '@'
                 INT 20h

                 DB ']'
                 RET
                 DB '$'

                 DB '['
BFLOOP:          CALL AQUI
AQUI:
                 POP SI
                 SUB SI,3h
                 PUSH SI
                 OR B[BX],CH
                 JNE FUERA
                 POP AX
BUCLE:           LODSB
                 CMP AL,0E8h
                 JNE OTRO
                 INC CX
OTRO:            CMP AL,0C3h
                 JNE BUCLE
                 LOOP BUCLE
                 JMP SI
FUERA:           DB '$'



For those who don't want to assemble this compiler of BF, here is the uuencoded version of the COM executable:

CODE

begin 644 bf.com
MM`FZ)P'-(;0(S2&_5@%/.`5T!C@M=??K\(GZ0E"T"<TA6#Q`=>'#MX"+RXG?
M\ZHD`#Y#)#Q+)"O^!R0M_@\D+K0"BA?-(20LM`C-(8@')$#-(%W#)%OH``!>
8@^X#5@@O=0]8K#SH=0%!/,-U]N+T_^8D
`
end



You use this compiler to generate .COM executables from BF source code. The source code must not have any character other than BF commands, and the BF program must end with the "@" character flag. For example, the random number generator above mentioned:

CODE

>>>++[
<++++++++[
<[<++>-]>>[>>]+>>+[
-[->>+<<<[<[<<]<+>]>[>[>>]]]
<[>>[-]]>[>[-<<]>[<+<]]+<<
]<[>+<-]>>-
]<.[-]>>
]@


Then you use the compiler by writing this command line:

BF <RANDOM.BF >RANDOM.COM

And then you run RANDOM.COM to watch the result...

If you need to clean up the code, you can use my BF sourcecode cleaner (CLEAN.BF):

CODE

+[>,[>+>>+<<<-]++++++++[>--------<-]>[<<+>><+++[>+++++++<-]+>[<->[
->+<]]<[>>>.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]+>+[<->[->+<]]<[>>>
.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]+>>+++++++[<-->-]<[<->[->+<]]<
[>>>.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]+>>+++++++[<---->-]<-[<->[
->+<]]<[>>>.<<<-]+>>--[<<->>[-<+>]]<<[>>>.<<<-]>[-]]>>[-]<<<<-]>++
++++++[<++++++++>-]<.@


Then you compile CLEAN.BF into CLEAN.com:

BF <CLEAN.BF >CLEAN.COM

And then, to compile any commented BF program:

CLEAN <program.bf | BF >program.com

Try out this code:

CODE
+[->,.-------------]<[++++++++++++++.<]@


This is my Hello World in BF:

CODE

>+++++++++[<++++++++>-]<.>+++++[<++++++++>-]<-.---.>+++[<---->-]<+.[-]>+++++[<++++++>-]<++.>++++++[<+++++++>-]<+++.>+++++[<++++++++>-]<.-------.+>>>+++++[<+++++[<++++>-]>-]<<.<.>>>+++++[<++++++>-]<+++.-.<<++++.----.++++++++++.>>.<[-]>[<++>-]+++[<++++>-]<+.[-]++++[<------>-]<.>++++[<++++>-]<+.---------.++++++.[-]>++++++++[<++++++>-]<--.@


I've attached a BF debugger of my creation for debugging these BF programs (so you will understand quickly their operation.

Comment/Reply (w/o sign-up)

cristofd
QUOTE (Darren @ Nov 18 2004, 02:36 AM)
This language is very complicated considering the minimal amount of commands. I greatly admire anyone who takes the time to use it on complex programs. Even simple programs for that matter. Are there many games written in it? Does anyone know where i try some out?
*


No games yet. Probably the closest thing is the cellular automaton "life", here:
http://www.df.lth.se/~lft/brain****/

Tic-tac-toe and guess-a-number are on my to-do list, but they've been there a while.

The best general source for brain**** source code is the repository at:
http://esoteric.sange.fi/brain****/

(Fix censoring in both URLs.)

Good luck;
-Daniel Cristofani.

Comment/Reply (w/o sign-up)

Darren
This language is very complicated considering the minimal amount of commands. I greatly admire anyone who takes the time to use it on complex programs. Even simple programs for that matter. Are there many games written in it? Does anyone know where i try some out?

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2, 3
Similar Topics

Keywords : Brainfck World39s Smallest Hardest


    Looking for brainf, ck, worlds, smallest, hardest, languag

See Also,

*SIMILAR VIDEOS*
Searching Video's for brainf, ck, worlds, smallest, hardest, languag
advertisement



Brainf*ck - World's Smallest And Hardest Language

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com