Brainfuck
Brainfuck is a minimalistic programming language, described elsewhere. Its beauty lies in its simplicity, and trying to use it is a truly fascinating experience.
Here is a little something from me:
Here is an example of some typical output generated by this program. The user first enters some data for an eight generation oscillator, and then the program calculates the rest.
New world record in BF Quine size...
The Portable Brainfuck Interpreter (by Urban Mueller, who also created the language) has an undocumented feature: Because the program and its data are kept in the same array, it is possible to write self-modifying Brainfuck code. Regard this simple Quine:+[-<+]-ÿ<<<<<<<[.>]
Discuss this page
Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.
Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.
Wed 11-Mar-2009 17:48
50 more comments hidden. Click to show all.
Sat 4-Jul-2009 13:37
Thx,lord.
Sun 5-Jul-2009 18:26
Thx,lord.
What's amazing is when you posted.
Linus Åkesson
Wed 8-Jul-2009 16:29
Thx,lord.
I wrote it from scratch, but with plenty of comments and whitespace to keep everything straight in my poor head. =)
Mon 2-Aug-2010 22:58
Sun 8-May-2011 16:48
Fri 17-Jun-2011 13:27
Must be a pretty piece of work! I once tried Conways Life too but I gave up ;)
Tue 28-Jun-2011 19:48
My Head already starts exploding and overheating when just THINKING about GOL. If I would have to program it... oh my god.
You didn't just program/code it, you f*cking did it in BRAINFUCK!!
This _literally_ fucks my brain!
I love you.
I just hope to become a good C++ Coder and maybe create some demos or sth like that... But I don't think I will ever achieve what you achieved.
You are a larger-than-life. Keep up the good work!
Wed 7-Nov-2012 15:36
And the implementation is so simple! I changed the output to stdout instead of stderr. This is my brainfuck interpreter for stdout in one line :
char m[9999],*n[99],*r=m,*p=m+5000,**s=n,d,c; main(){for(read(0,r,4000);c=*r;r++)c-']'||(d>1||(r=*p?*s:(--s,r)),!d||d--),c-'['||d++||(*++s=r),d||(*p+=c=='+',*p-=c=='-',p+=c=='>',p-=c=='<',c-'.'||write(1,p,1),c-','||read(1,p,1));}
Hehe works with your game of life. Honestly that must have taken ages to implement. I get a headache after the first line in your life.bf file ;).
Greets and keep up all your awesome work,
Walter Schreppers
Fri 13-Sep-2013 16:32
What I'd love to do is use this as a benchmark program; only problem is it doesn't take very long to run...
"real 0m0.049s"
That's for your example script.
Any chance of a larger array ?
Dynamic would be sooooo wonderful but 26x26 should give me enough space to draw a nice pattern.
Wed 9-Oct-2013 21:27
It seems like the [elsewhere] link above is not valid anymore. Or at least not just now...
"De pagina is niet gevonden"
/Ron
Fri 11-Oct-2013 09:19
Tue 4-Feb-2014 22:15
Wed 27-Aug-2014 18:09
Sat 24-Oct-2015 17:42
Thu 21-Jan-2016 22:04
YOU SON OF A BITCH !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I'LL KILL YA !!!!!!!!!!!!!!!!!!!!!!
Thu 21-Jan-2016 22:06
Tue 26-Jan-2016 20:22
Thu 11-Feb-2016 13:11
My Head already starts exploding and overheating when just THINKING about GOL. If I would have to program it... oh my god.
You didn't just program/code it, you f*cking did it in BRAINFUCK!!
This _literally_ fucks my brain!
I love you.
I just hope to become a good C++ Coder and maybe create some demos or sth like that... But I don't think I will ever achieve what you achieved.
You are a larger-than-life. Keep up the good work!
Sat 22-Oct-2016 05:11
Sun 18-Dec-2016 14:10
++++[ ->+++ +<]>+ +++.< +++++ +++[- >---- ----< ]>--- --.+. ----- -.<++
+++++ [->++ +++++ <]>++ ++.-- --.<+ +++++ [->-- ----< ]>--- ----- .----
--.++ +++++ +.<++ +[->- --<]> --.++ +++.+ +++.- .<+++ +++[- >++++ ++<]>
+++++ +++.< +++++ ++[-> ----- --<]> ---.+ +++++ +.+++ ++.-- ----- .<+++
++++[ ->+++ ++++< ]>+++ .<+++ ++++[ ->--- ----< ]>--- ----- .<+++ ++++[
->+++ ++++< ]>+++ .<+++ ++++[ ->--- ----< ]>.++ ++.-- -.--- -.<++ +++++
[->++ +++++ <]>++ ++.<+ +++++ [->-- ----< ]>--- ----- ---.- --.<+ +++++
+[->+ +++++ +<]>+ ..<++ ++++[ ->--- ---<] >---- --.-- -.+.+ ++.-- ---.+
++++. ----- ----. <++++ ++++[ ->+++ +++++ <]>++ +++++ +++++ +.<
<!----><!--]--><!--+++--><!--]-->
Fri 10-Mar-2017 04:23
Sun 2-Apr-2017 22:35
Sun 13-Aug-2017 15:08
Sun 27-Aug-2017 13:43
~Coolq
Thu 5-Oct-2017 14:15
Sun 29-Oct-2017 09:15
.<+++ [->-- -<]>- ----. <++++ +++[- >++++ +++<] >++++ .<+++ [->-- -<]>-
--.-- --.<+ ++[-> ---<] >---. <++++ ++[-> ----- -<]>- ----- ----. +.+.+
.<+++ +++[- >++++ ++<]> +++++ ++.++ .+++. +++++ ++++. ----. +++++ .<+++
[->++ +<]>+ +++++ .<
Wed 24-Jan-2018 13:09
Thu 1-Mar-2018 22:55
Wed 20-Jun-2018 08:51
Tue 31-Jul-2018 08:10
I know the answer is "she".
Sun 5-Aug-2018 14:42
Fri 19-Oct-2018 13:11
Thx,lord.
What's amazing is when you posted.
Mon 22-Oct-2018 02:10
lft wrote:
Thx,lord.
I wrote it from scratch, but with plenty of comments and whitespace to keep everything straight in my poor head. =)
Did you type the comments? When I write bf code I have to write it on paper due to the difficulty of commenting and then type it onto the computer
Linus Åkesson
Thu 25-Oct-2018 08:05
The bf interpreter I used simply ignores any invalid characters. So it's just a matter of avoiding <>+-[],.
Tue 6-Nov-2018 03:27
..... ..... !.?.. ..... !?!!. ?!!!! !!?.? !.?!! !!!.. ..... ..... .!.?.
..... ...!? !!.?. ..... ..?.? !.?.. ..... .!.?. ..... ..... !?!!. ?!!!!
!!!!! !?.?! .?!.? ..... ....! ?!!.? ..... ...?. ?!.?. ..... !.?.. .....
!?!!. ?!!!! !!?.? !.?!! !!!!! !!!!. ..... ...!. ?.... ...!? !!.?. .....
?.?!. ?..!. ?.... ..... !?!!. ?!!!! !!!!? .?!.? !!!!! !!!!! !!!.? .....
..!?! !.?.. ....? .?!.? ....! .!!!. !!!!! !!!!! !!!!! !!.?. ..... .!?!!
.?... ...?. ?!.?. ..... !.!!! !!!!! !.?.. ..... ..!?! !.?.. ..... .?.?!
.?... ..... !.?.
Mon 19-Nov-2018 02:11
..... ..... !.?.. ..... !?!!. ?!!!! !!?.? !.?!! !!!.. ..... ..... .!.?.
..... ...!? !!.?. ..... ..?.? !.?.. ..... .!.?. ..... ..... !?!!. ?!!!!
!!!!! !?.?! .?!.? ..... ....! ?!!.? ..... ...?. ?!.?. ..... !.?.. .....
!?!!. ?!!!! !!?.? !.?!! !!!!! !!!!. ..... ...!. ?.... ...!? !!.?. .....
?.?!. ?..!. ?.... ..... !?!!. ?!!!! !!!!? .?!.? !!!!! !!!!! !!!.? .....
..!?! !.?.. ....? .?!.? ....! .!!!. !!!!! !!!!! !!!!! !!.?. ..... .!?!!
.?... ...?. ?!.?. ..... !.!!! !!!!! !.?.. ..... ..!?! !.?.. ..... .?.?!
.?... ..... !.?.
Sun 25-Nov-2018 11:13
..... ..... !.?.. ..... !?!!. ?!!!! !!?.? !.?!! !!!.. ..... ..... .!.?.
..... ...!? !!.?. ..... ..?.? !.?.. ..... .!.?. ..... ..... !?!!. ?!!!!
!!!!! !?.?! .?!.? ..... ....! ?!!.? ..... ...?. ?!.?. ..... !.?.. .....
!?!!. ?!!!! !!?.? !.?!! !!!!! !!!!. ..... ...!. ?.... ...!? !!.?. .....
?.?!. ?..!. ?.... ..... !?!!. ?!!!! !!!!? .?!.? !!!!! !!!!! !!!.? .....
..!?! !.?.. ....? .?!.? ....! .!!!. !!!!! !!!!! !!!!! !!.?. ..... .!?!!
.?... ...?. ?!.?. ..... !.!!! !!!!! !.?.. ..... ..!?! !.?.. ..... .?.?!
.?... ..... !.?.
Tue 26-Feb-2019 11:31
..!?! !.?.. ..... ..... ..?.? !.?.. ..... ..... ..... ..... !.?.. .....
..... .!?!! .?!!! !!!!! !!!!? .?!.? !!!!! !!!!! !!!!! .?... ....! ?!!.?
!!!!! !?.?! .?!!! !!!!! !!!!! .!!!. ?.... ..... ..... .!?!! .?... .....
..... .?.?! .?!.? .
Tue 23-Apr-2019 03:37
Tue 23-Apr-2019 03:48
Tue 23-Apr-2019 04:02
Thu 25-Apr-2019 14:58
Tue 16-Jun-2020 21:01
Wed 24-Jun-2020 22:00
Thx,lord.
What's amazing is when you posted.
Wed 9-Sep-2020 08:40
Thu 14-Jan-2021 12:53
Sat 11-Dec-2021 02:44
Wed 28-Dec-2022 07:53
Sun 26-Nov-2023 04:44
-DLB
Sun 26-Nov-2023 15:48
Fri 15-Mar-2024 21:22
Fri 14-Jun-2024 14:29
Fri 24-Jan-2025 18:31
Thu 21-Aug-2025 15:00
Linus Akesson presents: The Game Of Life implemented in Brainfuck +>>++++[<++++>-]<[<++++++>-]+[<[>>>>+<<<<-]>>>>[<<<<+>>>>>>+<<-]<+ +++[>++++++++<-]>.[-]<+++[>+++<-]>+[>>.+<<-]>>[-]<<<++[<+++++>-]<.<<[>>>>+ <<<<-]>>>>[<<<<+>>>>>>+<<-]<<[>>>>.+<<<++++++++++[<[>>+<<-]>>[<<+>>>>>++++++++ +++<<<-]<[>+<-]>[<+>>>>+<<<-]>>>[>>>>>>>>>>>>+>+<< <<<<<<<<<<<-]>>>>>>>>>> >>[-[>>>>+<<<<-]>[>>>>+<<<<-]>>>]> >>[<<<+>> >- ]<<<[>>+>+<<<-]>[->[<<< <+>>>>-]<[<<< <+> >>>-]<<<< ]< ++++++ ++ +[>+++++<-]>>[<<+>>-]< <[>---<-]>.[- ] <<<<<<<<< < <<<<<< < -]++++++++++.[-]<-]>>> >[-]<[-]+++++ +++[>++++ ++++< - ]>--.[-]<,----------[<+ >-]>>>>>>+<<<<< < <[>+>>>>>+>[ -]<<< << <<-]>++++++++++>>>>>[[-] <<,<<<<<<<->>>> > >>[<<<<+>>>>-]<<<<[>>>>+ >+<<<<<-]>>>>>----------[<<<< <<<<+<[>>>>+<<< <-]>>>>[<<<<+>>>>>>+<<- ]>[>-<-]>++++++++++[>+++++++++ ++<-]<<<<<<[>>> >+<<<<-]>>>>[<<<<+>>>>> >+<<-]>>>>[<<->>-]<<++++++++++ [>+<-]>[>>>>>>> >>>>>+>+<<<< <<<<< <<<<-]>>> >> >>>>>>>[-[>>> >+<<<<-]>[>>>> +<<<<-]>> > ]>> > [<< < +>>>-]+<<<[> >>-<<<-]>[->[< <<<+>>>>-] <[ < < < <+>>>>-]<<< <]<<<<<<<<<<<, [ -]]>]>[-+++ ++ + +++ ++[>+++++++ ++++>+++++++++ + +<<-]>[-[>>> +<<<- ]>>>[ < <<+ >>>>>>>+>+< <<<<-]>>>>[-[> > >>+<<<<-]>[> >>>+< < <<-]> > >]> >>[<<<+>>>- ]<<<[>>+>+<<< - ]>[->[<<<<+> >>>-] < [<<< < +>> >>-]<<<<]<< <<<<<<[>>>+<< < -]>>>[<<<+>> >>>>> + >+<< < <<-]<<[>>+<< -]>>[<<+>>>>> >+>+<<<<<-]>> >>[-[ > >>>+ < <<<-]>[>>>>+< <<<-]>[>>>>+< <<<-]>>]>>>[ - ]<[>+< - ]<[ - [<<<<+>>>>-]<<< <]<<<<<<<<]<< <<<<<<<<++++ + +++++ [ >+++ + ++++++[<[>>+<<-]>>[<<+ >>>>>++++++++ + ++<<< -] < [>+<- ] >[<+ > >>>+<<<-]>>>[<<<+>>>-] <<<[>>>+>>>> > +<<<< << <<-]> > >>>> >>>[>>+<<-]>>[<<+<+>> >-]<<<------ - -----[ >> >+<<< - ]>>> [<<<+> > >>>>>+>+<<<< <-]>>>>[-[>> > >+<<<< -] > [>>>> + <<<<- ]>>> ] >>>[<<<+>>>- ]<<<[>>+>+<< < -]>>> >> > > [<<<+ >>>-]<<<[>>> +<<<<<+>>- ]> > >>>>>[< <<+>>>-]<<<[> >>+<<<<<<< <<+ > >>>>>-]< <<<<<<[->[<<<<+ >>>>-]<[<<<<+>>>>-]<<<<]>[<<<<<< <+>>> >>>>-]<<<< <<<<<+++++++++++[> >>+<<<-]>>>[<<<+>>>>>>>+>+<<<<<-]>>>>[-[> >>>+<<<<-]>[>>>>+<<<<-]>>>]>>>[<<< +>>>-]<<<[>>+>+<<<-]>>>>>>>[<<<+>>>-]<<<[ >>>+<<<<<+>>-]>>>>>>>[<<<+>>>-]<<< [>>>+<<<<<<<<<+>>>>>>-]<<<<<<<[->[< < < <+>>>>-]<[<<<<+>>>>-]<<<<]>[<<<<<<< +>>>>>>>-]<<<<<<<<<+++++++++++[>>> > >>>+>+<<<<<<<<-]>>>>>>>[-[>>>>+<<<<- ]>[>>>>+<<<<-]>>>]>>>[<<<+>>>-]<<< [ >>+>+<<<-]>>>>>>>[<<<+>>>-]<<<[>>>+<< <<<+>>-]>>>>>>>[<<<+>>>-]<<<[>>>+< <<<<<<<<+>>>>>>-]<<<<<<<[->[<<<<+>>>>- ]<[<<<<+>>>>-]<<<<]>[<<<<<<<+>>>>> >>-]<<<<<<<----[>>>>>>>+<<<<<<<+[>>>>> >>-<<<<<<<[-]]<<<<<<<[>>>>>>>>>>>>+>+<<<<<<<<<<<<<-][ lft@df.lth.se ]>>>>> >>>>>>>[-[>>>>+<<<<-]>[>>>>+<<<<-]>[>>>>+<<<<-]>>]>>>[-]<[>+<-]<[-[<<<<+>> >>-]<<<<]<<<<<<[-]]<<<<<<<[-]<<<<-]<-]>>>>>>>>>>>[-]<<]<<<<<<<<<<] Type for instance "fg" to toggle the cell at row f and column g Hit enter to calculate the next generation Type q to quit