ChatGPT and BrainFuck

........

I always wanted to write some useful code in BrainFuck (besides to too basic "Hello World"). I never wanted this so bad though to worth the hassle of actually learning to write BrainFuck code.

Let's see how good ChatGPT is at writing BrainFuck code.

 


Doesn't seems like a lot of code...

Let's run it.


It doesn't seem to do the right thing:



Polite, but rather useless.


Thanks for nothing.

I was able to find a working tictactoe implementation in the BrainFuck language, here - https://raw.githubusercontent.com/elikaski/BF-it/master/examples/games/tic_tac_toe.bf, written by a Python script implemented by a human. 

And it's indeed working.




Let's try something simpler:


Well, not quite...





It's indeed changed:

Now it does nothing :)







A similar exercise with Python, Java or C provides way better results. I suppose there is not enough BrainFuck data on the Internet to allow ChatGPT to fully train for it. 

So, still no TicTacToe game for me yet (unless I write it myself).

PS:
Several hours later, I asked ChatGPT the same thing. Now it says it's not possible :D




Well, my friend, you are wrong. It is possible




Comments