Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › brainfuck Programming

brainfuck Programming

Posts 1–15 of 19 · Page 1 of 2
SO
sockopen
brainfuck Programming
This tutorial is for the programming language Brainfuċk, I used the Brainfuċked compiler, there's also a popular Brainfuċk interpreter in PHP. The Brainfuċked compiler is 799 bytes, has syntax checking, and of course is open source. The smallest compiler in the world is for Brainfuċk, and is 171 bytes.

Brainfuċk is a cross-platform programming language with only eight instructions, and no operands, no variables, no conditions, and of course no functions.

Let's go through all of the possible instructions you can use with Brainfuċk:

> move the memory pointer to the next memory block
< move the memory pointer to the previous memory block
+ increases the memory cell under the memory pointer
- decreases the memory cell under the memory pointer
[ starts a 'while' loop "c while(cur_block_value != 0)"
] ends a 'while' loop
. writes the contents of the memory cell under the memory pointer as an ASCII character "c putchar()"
, reads an ASCII character input and fills the memory cell under the memory pointer "c getchar()"

Anything that's not one of those eight characters will be ignored by the compiler and taken as comments. The memory pointer always starts on the left-most memory block, and all memory blocks start with a zero value.



Now let's do some coding, open up Notepad, and remember to save your projects as *.b's.

First Program
Code:
+++++[-]
That's the full code for our first program in brainfuċk, normally you start with a Hello World program, but, we'll get there eventually, it's more complex than you would first imagine.

+++++[-] does several things. First we are increasing the memory cell under the memory pointer to five. Then we enter a loop that loops subtracting our value of five by one until it reaches zero, then exits the loop. This could take up to five lines of code in a language such as C, which is also less efficient.

Second Program
Code:
>>>++
This moves our memory pointer to the third memory block and increases the memory cell's stored value by two.

Now let's add onto this program, we'll change several memory cell's values.

Code:
>>>++<<+>>+++
Now this program moves our memory pointer to the third memory block, increases the memory cell's stored value by two, goes back to the first memory block and increases that memory cell's stored value by one. Then goes back to our third memory block and increases our existing memory cell value (of two), to five by incrementing it by three.

Final Program
Until now, you haven't been able to see your own programs' calculations. Let's create a program that has some output, the 'Hello World' program.

Code:
>+++++++++[<++++++++>-]<.[-]
>++++++++++[<++++++++++>-]<+.[-]
>+++++++++++[<++++++++++>-]<--..[-]
>+++++++++++[<++++++++++>-]<+.[-]
>+++++++[<++++++>-]<++.[-]
>++++++[<+++++>-]<++.[-]
>++++++++++[<+++++++++>-]<---.[-]
>+++++++++++[<++++++++++>-]<+.[-]
>+++++++++++[<++++++++++>-]<++++.[-]
>+++++++++++[<++++++++++>-]<--.[-]
>++++++++++[<++++++++++>-]<.[-]
+++++++++++++.---.-
Since we can only work with numbers, we have to use characters' ASCII values to represent the characters we want to output.

Program Breakdown:

Code:
>+++++++++[<++++++++>-]<.
First increases the memory pointer to the first memory block, and increases the memory cell's value to nine. We then enter our loop, go back to our zero block and change it's value to eight, go back to our first memory block and decrease the memory cell's stored value to eight, and, returns back to the start of our loop until the memory cell the memory pointer is on is equal to zero. This loop continues until our zero memory block is at 72, and our first memory block is at zero. We then return our memory pointer to the zero memory block, and with our '.', we print the ASCII decimal value, which represents the letter 'H'.

As you can imagine, it then goes through the rest of the characters and does the same.



I hope you enjoy programming in Brainfuċk as much as I have. Once you get good with Brainfuċk, I suggest moving to Brainfork and Braintwist, which still use the core idea of Brainfuċk, with extra capabilities.
#1 · 20y ago
RC
RCEisForMe
Hang on, why would you program in brainfuck when you could program in c, or asm, or if you swing that way another pointless, esoteric language like cow? (http://en.wikipedia.org/wiki/COW_programming_language)
#2 · 20y ago
SO
sockopen
It's a challenge, which aspiring programmer would not like to know an extra language? Especially one so challenging and unique such as brainfuck?
#3 · 20y ago
Dave84311
[MPGH]Dave84311
Can't say I have heard of "BrainFuck"
#4 · 20y ago
gunot
gunot
looks ugly...
#5 · 20y ago
RC
RCEisForMe
Like Cow, Brainfuck is pretty much a joke language, like that 1337-speak programming language.
#6 · 20y ago
pepsi_dude_777
pepsi_dude_777
hmm, brainfuck program, never heard of it either, i think C++ would be easier
#7 · 20y ago
SH
shercipher
The point of brainfuck is to be hard not to be useful.

There is one called fuckfuck (not related) in which the entire language is composed of curse words.
#8 · 20y ago
arunforce
[MPGH]arunforce
Binary seems hardest, no matter how you look at it.
#9 · 20y ago
SpiderByte
SpiderByte
Binary is easy as shit
#10 · 20y ago
Firey
Firey
if you pass this, you can code binary.

There a 10 types of people in the world, those who read binary, and those who don't.
#11 · 20y ago
Dave84311
[MPGH]Dave84311
Ugh.... RIGHT... Binary ain't easy as shit wtf. Try writing a whole program in binary...
#12 · 20y ago
[G
[gen]
noone programs in binary anymore, binary is just how the machine interprets other programming languages..it was the whole reason assembly came to life.
#13 · 20y ago
BA
BaGGy
Brainfuck was written just for fun, and is somewhat a language but not a useful one. Or not even a language people will use.

Also, you really didnt write that tutorial, you took it from an earlier version of the wikipedia page, damn biters...
#14 · 20y ago
MI
Mikoll
it's so fnny how everyone keeps saying it and no one has said anything about the name ahahaha... Brainfuck
#15 · 20y ago
Posts 1–15 of 19 · Page 1 of 2

Post a Reply

Similar Threads

  • Problem Wit Hacking ProgramsBy f5awp in General Gaming
    5Last post 20y ago
  • a good java programBy snipelock in Java
    18Last post 17y ago
  • Runescape 2 auto programsBy fabled in Hack Requests
    19Last post 19y ago
  • Ennyone know of HACKING PROGRAMSBy daniel1322dan in General Hacking
    9Last post 18y ago
  • [Tutorial] Your first programBy akimoko in C++/C Programming
    10Last post 19y ago

Tags for this Thread

None