Last active
September 12, 2022 08:30
-
-
Save blahgeek/dd58a29a37e97fdf29f0 to your computer and use it in GitHub Desktop.
Brainfuck quine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run `cat quine.bf | sed 's/#.*//' | tr '\n' ' ' | sed 's/ //g'` to remove comments | |
# Character map (according to frequency): | |
# + > < [ ] - . | |
# 1 2 3 4 5 6 7 | |
# 43 62 60 91 93 45 46 | |
# start | |
>>> | |
# data | |
>++ | |
>++ | |
>++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++ | |
>++++ | |
>+++ | |
>+ | |
>+++ | |
>+ | |
>++ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>++++ | |
>++ | |
>+ | |
>+++ | |
>++++++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>+++++ | |
>++ | |
>+++++ | |
>+++ | |
>+++ | |
>++++++ | |
>++ | |
>++ | |
>++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>++++++ | |
>++++++ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>+++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++ | |
>++++ | |
>++ | |
>+++++ | |
>++ | |
>++++ | |
>++ | |
>+++++ | |
>+++ | |
>+ | |
>++++ | |
>+++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++++ | |
>+++++ | |
>+++++ | |
>+++++ | |
>+++++ | |
>+++++ | |
>+++++ | |
>++ | |
>+++++ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>++ | |
>++++ | |
>+++ | |
>+++ | |
>+ | |
>++ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>++++ | |
>++ | |
>+ | |
>+++ | |
>++++++ | |
>+++++ | |
>+++ | |
>+++++++ | |
>++ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++++++ | |
>+++ | |
>+ | |
>++++ | |
>+++ | |
>+ | |
>+++++ | |
>+++ | |
>++++ | |
>+++ | |
>+++++ | |
>++ | |
>++++ | |
>+++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+ | |
>+++ | |
>++++++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++++ | |
>+++++++ | |
>+++ | |
>+ | |
>+ | |
>+ | |
>+ | |
>++++ | |
>++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>+++ | |
>++++++ | |
>+++++ | |
>++ | |
>++++++ | |
>++++++ | |
>++++++ | |
>++ | |
>++++ | |
>+++ | |
>+++++++ | |
>++ | |
>++++++ | |
>+++++ | |
>+++ | |
>++++ | |
>++++++ | |
>+++++ | |
>++ | |
>++ | |
>+++++ | |
>+ | |
>++++ | |
>++ | |
>+ | |
>+++++ | |
>++ | |
>++ | |
>++++ | |
>+++++++ | |
>++ | |
>+++++ | |
# return to first char | |
[<] > | |
# copy data | |
[ # for each data | |
[<+<+>>-] # copy to left two cells | |
<[>+<-]> # copy back from left cell | |
[>]>[>]+ | |
[<]<[<]>- | |
[ # while greater than 0 | |
[>]> [>]< + | |
[<]<[<]> - | |
] | |
> | |
] | |
<<->> | |
> | |
# Apply character map | |
[ | |
# go to end of data plus 1; adds up to 43 | |
[>]> [>] | |
>++++++++ # for range(8) | |
[<+++++>-] # adds 5 | |
<+++ # adds 3 | |
[<]<[<]> # return to the character | |
- # minus 1 | |
# if greater than 0 | |
[ | |
# total 19 | |
[>]> [>]< | |
>++++ # for range(4) | |
[<++++>-] # adds 4 | |
<+++ # adds 3 (19 totally) | |
[<]<[<]> | |
- | |
[ | |
[>]> [>]< -- # 62 to 60 | |
[<]<[<]> | |
- # minus 1 | |
[ | |
[>]> [>]< | |
>+++++ # for range(5) | |
[<++++++>-] # adds 6 | |
<+ # adds 1 (31 totally) | |
[<]<[<]> | |
- | |
[ | |
[>]> [>]< ++ # adds 2 | |
[<]<[<]> # go back to char | |
- # minus 1 | |
# 93 to 45 | |
[ | |
[>]> [>]< | |
>+++++++ # for range(7) | |
[<------->-] # minus 7 | |
<+ # adds 1 (minus 48 totally) | |
[<]<[<]> | |
- | |
[ | |
[>]> [>]< + # adds 1 | |
[<]<[<]> # go back to char | |
- # minus 1 | |
] | |
] | |
] | |
] | |
] | |
] | |
> # go to next char | |
] | |
# Print first 3 ascii | |
+++ | |
[ | |
# move the data to left cell | |
> [<<+>>-] < | |
# move to right cell | |
[>+<-] | |
<.>> # print it | |
- | |
] | |
<[<] | |
# go to orig data | |
-< | |
+[<+] | |
<[<]> | |
# Print data (data format) | |
[ | |
<<++++++++ # for range(8) | |
[>++++++++<-] # plus 8 | |
>-- # 62 | |
. # ">" | |
# 62 to 43 | |
<++++ # for range(4) | |
[>----<-] # minus 4 | |
>--- # 43 | |
> | |
[<.>-] # print "+" | |
<[-]> # reset left cell to zero | |
> | |
] | |
+[>+] # go until 255 | |
>> | |
[.>] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>>>++>++>++>++++>+++>+++++>++>++++>++++>+++>+>+++>+>++>++>++++++>+++++>+++>++++>++>+>+++>++++++>+++++>++>++++>++>+++++>++>++++>++>+++++>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>+++++>++>+++++>+++>+++>++++++>++>++>++>++++>++++>++>+++++>++>++++>++>+++++>++>+>+>+>+>+>+>+>+>++++>+++>+>+>+>+>+>++>++++++>+++++>+++>+>+>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>++>+>+>+>+>++++>+++>+>+>+>+>++>++++++>+++++>+++>+>+>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>++++++>++++++>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>++>+>+>+>+>+>++++>+++>+>+>+>+>+>+>++>++++++>+++++>+++>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>+>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>++>+>+>+>+>+>+>+>++++>+++>++++++>++++++>++++++>++++++>++++++>++++++>++++++>++>++++++>+++++>+++>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>++++>++++>++>+++++>++>++++>++>+++++>+++>+>++++>+++>+++++>+++>++++>+++>+++++>++>++++++>+++++>+++++>+++++>+++++>+++++>+++++>++>+++++>+>+>+>++++>++>++++>+++>+++>+>++>++>++++++>+++++>+++>++++>++>+>+++>++++++>+++++>+++>+++++++>++>++>++++++>+++++>+++>++++>+++>+++++>++++++>+++>+>++++>+++>+>+++++>+++>++++>+++>+++++>++>++++>+++>+++>+>+>+>+>+>+>+>+>++++>++>+>+>+>+>+>+>+>+>+++>++++++>+++++>++>++++++>++++++>+++++++>+++>+>+>+>+>++++>++>++++++>++++++>++++++>++++++>+++>++++++>+++++>++>++++++>++++++>++++++>++>++++>+++>+++++++>++>++++++>+++++>+++>++++>++++++>+++++>++>++>+++++>+>++++>++>+>+++++>++>++>++++>+++++++>++>+++++[<]>[[<+<+>>-]<[>+<-]>[>]>[>]+[<]<[<]>-[[>]>[>]<+[<]<[<]>-]>]<<->>>[[>]>[>]>++++++++[<+++++>-]<+++[<]<[<]>-[[>]>[>]<>++++[<++++>-]<+++[<]<[<]>-[[>]>[>]<--[<]<[<]>-[[>]>[>]<>+++++[<++++++>-]<+[<]<[<]>-[[>]>[>]<++[<]<[<]>-[[>]>[>]<>+++++++[<------->-]<+[<]<[<]>-[[>]>[>]<+[<]<[<]>-]]]]]]>]+++[>[<<+>>-]<[>+<-]<.>>-]<[<]-<+[<+]<[<]>[<<++++++++[>++++++++<-]>--.<++++[>----<-]>--->[<.>-]<[-]>>]+[>+]>>[.>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
6