Skip to content

Instantly share code, notes, and snippets.

@palash25
Last active March 8, 2017 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palash25/2b1204f5929120758627a6e3a2867b4c to your computer and use it in GitHub Desktop.
Save palash25/2b1204f5929120758627a6e3a2867b4c to your computer and use it in GitHub Desktop.
Spoj problem to print "SPOJ is indeed awesome" in BRAINFUCK
//BFUCK program to print "SPOJ is indeed awesome".
++++++++++ //increment cell 0 to 10
[
>+++ // cell 1 = 3
>+++++ // cell 2 = 5
[
>++ // cell 3 = 5*2
>++
>++
>++
>++
<<<<<-
]
>-- // cell 3 = 8*10
>--- // cell 4 = 7*10
>>+ // cell 6 = 11*10
>++ // cell 7 = 12*10
[<]
<<- // decrementing cell 0
]
>++ // cell 1 = 32
>>+++.---.-. // printing "SPO"
>++++. // printing "J"
<<<. // printing space
>>>>+++++. // printing "i"
>+++++. // printing "s"
<<<<<. // printing space
>>>>. // "i"
>-----. // "n"
<-----.+..-. // "deed"
<<<<. // space
>>>>---.// "a"
>>-. // "w"
<<++++. // "e"
>>----. // "s"
<+.--. // "om"
<. // "e"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment