Author Topic: Brainfuck Programs  (Read 16976 times)

0 Members and 1 Guest are viewing this topic.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Brainfuck Programs
« Reply #15 on: August 21, 2010, 12:59:09 pm »
I managed to find a decent sized game here: http://jonripley.com/i-fiction/games/LostKingdomBF.html
The game was originally written in BBCBasic at 2.74KB, but the BF is 2.08MB x.x
Too bad it's too large for the calc :P
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Brainfuck Programs
« Reply #16 on: August 21, 2010, 01:01:56 pm »
Yeah x.x. I wonder if anyone ever did some sort of semi graphical games with that.

Offline skuller972

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 335
  • Rating: +11/-4
  • BEAST MODE
    • View Profile
Re: Brainfuck Programs
« Reply #17 on: August 21, 2010, 01:15:51 pm »
Fibonacci Sequence!!!!

Code: [Select]
BF,FIB
>+                 ;sets cell 0 as 0 and cell 1 as 1, to start the sequence
[                  ;holds entire sequence loop in brackets
[>+>+<<-]          ;duplicates cell 1 into cell 2 and cell 3
>[<+>-]            ;scootches cell 2 over to cell 1
>[<+>-]            ;scootches cell 3 to cell 2
<<<[>>+<<-]        ;adds cell 0 to cell 2, deleting cell 0, and setting cell 2 as the current answer
.>,[-]<            ;displays current answer, then asks for input, then deletes inputed cell, for a pseudo pause
>[<+>-]            ;scootches cells over again
>[<+>-]<           ;now all cells are scootched and set for another loop
]                  ;ends loop
Then again, maybe not...
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/bc7bf8e12353f09e.png" alt="NerdTests.com says I'm a Cool Non-Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Brainfuck Programs
« Reply #18 on: August 21, 2010, 01:49:36 pm »
Nice, except that will display the characters $00,$01,$02,$03,$05,$08,$0D,$15,$22,$37, and so on, not the numbers.
Who wants to write a divby10 routine? (I will momentarily if no one else does)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline skuller972

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 335
  • Rating: +11/-4
  • BEAST MODE
    • View Profile
Re: Brainfuck Programs
« Reply #19 on: August 21, 2010, 03:07:35 pm »
whoops! i forgot i didnt show numbers. my bad.
Then again, maybe not...
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/bc7bf8e12353f09e.png" alt="NerdTests.com says I'm a Cool Non-Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Brainfuck Programs
« Reply #20 on: August 21, 2010, 04:01:24 pm »
Blah, I'll write the routine when I have more free time. It's not very fun when you have to test two conditions at once (which is required in the routine AFAICT).
Or maybe I can find one online :P
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

SirCmpwn

  • Guest
Re: Brainfuck Programs
« Reply #21 on: August 21, 2010, 04:02:40 pm »
Oh god, I hate brainfuck so much x.x

Offline skuller972

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 335
  • Rating: +11/-4
  • BEAST MODE
    • View Profile
Re: Brainfuck Programs
« Reply #22 on: August 21, 2010, 04:13:39 pm »
i just spent like 30 minutes trying to figure out how to display decimal. no luck. ps SirCmpwn you are about to be 1337 posts
Then again, maybe not...
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/bc7bf8e12353f09e.png" alt="NerdTests.com says I'm a Cool Non-Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>

SirCmpwn

  • Guest
Re: Brainfuck Programs
« Reply #23 on: August 21, 2010, 04:27:47 pm »
And......
YEAH!
Brainfuck is named quite well, it fucks with your brain.

1337 Posts!!!!1!111!!!!

Offline patriotsfan

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 118
  • Rating: +2/-0
  • Go Pats!
    • View Profile
Re: Brainfuck Programs
« Reply #24 on: August 21, 2010, 08:55:57 pm »
Unless it provides pleasure for the select few who actually like being confused! :P


Doomsday: 12/21/2012 6:11 AM EST 11:11 AM GMT

Offline skuller972

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 335
  • Rating: +11/-4
  • BEAST MODE
    • View Profile
Re: Brainfuck Programs
« Reply #25 on: August 22, 2010, 01:15:14 pm »
got it! fibonacci sequence, printing the decimal values of the numbers. it only goes up to 255 though, since its hex, so after 233 the fibonacci seequence gets wonky. I didnt write the part that prints the decimal values, so i enclosed it in asterisks. heres where i got it http://mazonka.com/brainf/


Code: [Select]
>+
[
[>+>+<<-]
>[<+>-]
>[<+>-]
<<<[>>+<<-]
>[<+>-]
>[<+>-]<

[>>>>>+>+<<<<<<-]>>>>>[-<<<<<+>>>>>]>              ;copies cell 1 to cell 5 and 6, then moves cell 5 back to cell 1, in essence just copying cell 1 to cell 6, giving space for the decimal printer

***************************************
  [ -<++>
  [ -<+>
    [ -<+>
      [ -<+>
        [ -<+>
          [ -<+>
            [ -<+>
              [ -<+>
                [ -<+>
                  [ <[-]+> ->+< [<-] ]
  ]]]]]]]] >]

<<[>++++++[<++++++++>-]<-.[-]<]
***************************************

<<<<                                                ;moves pointer back to cell 1 for sequence
>,[-]<
]
Then again, maybe not...
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/bc7bf8e12353f09e.png" alt="NerdTests.com says I'm a Cool Non-Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Brainfuck Programs
« Reply #26 on: August 22, 2010, 04:12:21 pm »
darn this language looks so much harder to read than z80. It has to do with the fact it uses no alphabet and the like x.x

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Brainfuck Programs
« Reply #27 on: August 22, 2010, 07:42:54 pm »
That, combined with the fact that z80 ASM has nice mnemonics, like add, sub, ld, etc. while BF has only 8 symbols and can't have subroutines that make for nice, structured programming ;D
I doubt the existence of a good number of people who can easily understand what a piece of BF does. :P
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline skuller972

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 335
  • Rating: +11/-4
  • BEAST MODE
    • View Profile
Re: Brainfuck Programs
« Reply #28 on: August 23, 2010, 10:08:20 am »
I tried learning asm, but either I didnt try hard enough to learn or I just didnt get it, but I understand brainfuck a lot more than asm
Then again, maybe not...
<a href="http://www.nerdtests.com/ft_nt2.php">
<img src="http://www.nerdtests.com/images/badge/nt2/bc7bf8e12353f09e.png" alt="NerdTests.com says I'm a Cool Non-Nerd.  Click here to take the Nerd Test, get nerdy images and jokes, and talk to others on the nerd forum!">
</a>

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Brainfuck Programs
« Reply #29 on: August 23, 2010, 10:21:09 am »
What does this do? (No running it ;D)
Code: [Select]
>+++++++++[<+++++++++++>-]<[>[-]>[-]<<[>+>+<<-]>>[<<+>>-]>>>
[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++++++++++>>>+<
-]<<-<-]+++++++++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-]<<<
[>>+>+<<<-]>>>[<<<+>>>-]>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<+++
+++++[<++++++<++++++>>-]>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-
]<<<<<<.>>[-]>[-]++++[<++++++++>-]<.>++++[<++++++++>-]<++.>+
++++[<+++++++++>-]<.><+++++..--------.-------.>>[>>+>+<<<-]>
>>[<<<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<+++++++
+>-]<.>+++++++++[<+++++++++>-]<--.---------.>+++++++[<------
---->-]<.>++++++[<+++++++++++>-]<.+++..+++++++++++++.>++++++
++[<---------->-]<--.>+++++++++[<+++++++++>-]<--.-.>++++++++
[<---------->-]<++.>++++++++[<++++++++++>-]<++++.-----------
-.---.>+++++++[<---------->-]<+.>++++++++[<+++++++++++>-]<-.
>++[<----------->-]<.+++++++++++..>+++++++++[<---------->-]<
-----.---.>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>>+++
+[<++++++>-]<--.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.
><+++++..--------.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++
++++++++++++.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<++
+++++++>-]<--.---------.>+++++++[<---------->-]<.>++++++[<++
+++++++++>-]<.+++..+++++++++++++.>++++++++++[<---------->-]<
-.---.>+++++++[<++++++++++>-]<++++.+++++++++++++.++++++++++.
------.>+++++++[<---------->-]<+.>++++++++[<++++++++++>-]<-.
-.---------.>+++++++[<---------->-]<+.>+++++++[<++++++++++>-
]<--.+++++++++++.++++++++.---------.>++++++++[<---------->-]
<++.>+++++[<+++++++++++++>-]<.+++++++++++++.----------.>++++
+++[<---------->-]<++.>++++++++[<++++++++++>-]<.>+++[<----->
-]<.>+++[<++++++>-]<..>+++++++++[<--------->-]<--.>+++++++[<
++++++++++>-]<+++.+++++++++++.>++++++++[<----------->-]<++++
.>+++++[<+++++++++++++>-]<.>+++[<++++++>-]<-.---.++++++.----
---.----------.>++++++++[<----------->-]<+.---.[-]<<<->[-]>[
-]<<[>+>+<<-]>>[<<+>>-]>>>[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]
>[<+>-]>[<<++++++++++>>>+<-]<<-<-]+++++++++>[<->-]>>+>[<[-]<
<+>>>-]>[-]+<<[>+>-<<-]<<<[>>+>+<<<-]>>>[<<<+>>>-]<>>[<+>-]<
<-[>[-]<[-]]>>+<[>[-]<-]<++++++++[<++++++<++++++>>-]>>>[>+>+
<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>[-]++++[<++++++++>
-]<.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+++++..---
-----.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++
.>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<+++++++++>-]<-
-.---------.>+++++++[<---------->-]<.>++++++[<+++++++++++>-]
<.+++..+++++++++++++.>++++++++[<---------->-]<--.>+++++++++[
<+++++++++>-]<--.-.>++++++++[<---------->-]<++.>++++++++[<++
++++++++>-]<++++.------------.---.>+++++++[<---------->-]<+.
>++++++++[<+++++++++++>-]<-.>++[<----------->-]<.+++++++++++
..>+++++++++[<---------->-]<-----.---.+++.---.[-]<<<]
If you do run it though, it's a fun program (not mine, though, I must say)
My only point is that things get confusing really quickly :P
But who knows, you probably understand this language better than I do :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.