mircea_007's blog

By mircea_007, history, 5 years ago, In English

The case for brainfuck

Brainfuck is a widely known programming language but it lacks recognition from the competitive programming comunity. I am here to fix that.

Advantages

Brainfuck has many advantages over c++:

  1. Builtin fast i/o.
  2. Builtin O(1) time complexity (there is a finite number of states so you can either end up in a cycle or finish execution).
  3. Builtin O(1) space complexity (memory is limited to 30 000 bytes).
  4. Only 8 commands (no room for human error).
  5. You now have the power to understand any Benq source (really)
  6. Immune to hacks (except from 3000+ rated users who learn brainfuck before they can walk).

How to use

You might notice that there is no brainfuck option when choosing a language for your source code. This is no problem! You can use this C++ interpreter for brainfuck. This resource also contais a few classic examples (dfs, bfs, djikstra, Roy-Floyd etc.).

Conclusion

I thank you all for reading. Upvote for more quality content.

  • Vote: I like it
  • +146
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

Brainfuck doesn't optimise for modern CPU architectures.

»
5 years ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

So when will Codeforces add Brainfxxk compiler?

»
5 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

That is nice and all, but could you link an implementation to bitset in brainfuck? That would make your code complexity O(1) * O(1) = O(0), and that would really make the case

»
5 years ago, hide # |
 
Vote: I like it +98 Vote: I do not like it

Holy heck it works!!1!