Last visit was: It is currently Thu Mar 28, 2024 4:39 pm


All times are UTC-05:00




Post new topic Reply to topic  [10 posts ] 
    Author Message
     Post subject:Thoughts on brainfsck?
    PostPosted:Sat Nov 01, 2008 2:32 am 
    User avatar
     

    Joined:Mon Sep 22, 2008 9:51 am
    Posts:112
    I have been using this language for awhile now just due to how interesting I find it. What do you think of it.
    It is a turing complete language with only 8 commands: [],.<>+-

    Example of code in brainfsck, placing 128 in cell 1, 32 in cell 2, placing 48 in cell 3 and dividing cell 1 by cell 2 and placing the result in cell 1 ( ergo 8 ), then adding cell 3 to cell 1, and printing cell 1 ( which will print out the answer, ergo 8 ):
    Code:
    ++++[>>++++[<++++++++>-]<<-]>>>++++[<++++>-]>++++++[<++++++++>-][-]>[-]>[-]>[-]<<<<<<[>>>+<<<-]>>>[<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<[>+<<-[>>[-]>+<<<-]>>>[<<<+>>>-]<[<-[<<<<->>>>[-]]+>-]<-]<<<<+>>>]<[<<+>>>+<-]>[<+>-]<<<.
    It does use a few temporary cells during the division (actually 4 of them), incase your trying to follow the flow of the code. I could program up a copy that uses 16 bit ( 0 - 65535 ) values instead of the 8 bit ( 0 - 255 ) ones. But that program would be a quite a bit longer.


    EDIT:

    Here, I fixed it so you can see where I add the two numbers up (cell 1 and 2) theya re followed by an !, and I also made it so it can print out if the answer is more then 1 digit long (max of 3)
    Code:
    ++++[>>++++[<++++++++>-]<<-]>!>>++++[<++++>-]<!>>++++++[<++++++++>-][-]>[-]>[-]>[-]<<<<<<[>>>+<<<-]>>>[<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<[>+<<-[>>[-]>+<<<-]>>>[<<<+>>>-]<[<-[<<<<->>>>[-]]+>-]<-]<<<<+>>>][-]>[-]<<<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-][-]>[-]<<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-]++++++++++>[-]>[-]>[-]>[-]<<<<<<[>>>+<<<-]>>>[<[>>+>+<<<-]>>>[<<<+>>>-]<[>+<<-[>>[-]>+<<<-]>>>[<<<+>>>-]<[<-[<<<<->>>>[-]]+>-]<-]<<<<+>>>][-]>[-]<<[>+>+<<-]>>[<<+>>-][-]>[-]<<<[>>>+<<<-]>>>[<<[<+>>+<-]>[<+>-]>-]<<[-][-]>[-]>[-]>[-]<<<<<[>>+<<-]>>[<[>>+>+<<<-]>>>[<<<+>>>-]<[>+<<-[>>[-]>+<<<-]>>>[<<<+>>>-]<[<-[<<<->>>[-]]+>-]<-]<<<+>>]<<<[<<<->>>>>>+<<<-]>>>[<<<+>>>-]<<[<<<<->>>>>>+<<-]>>[<<+>>-]<<<<[<<+>>>>>>+<<<<-]>>>>[<<<<+>>>>-]<<<<[>+>>>>+<<<<<-]>>>>>[<<<<<+>>>>>-]<<<<<[>>+>>>>+<<<<<<-]>>>>>>[<<<<<<+>>>>>>-]<<<<.<.<<<.
    EDIT2: Forgot to fix the 1 digit spot if greater then 10, I changed the code above.

    EDIT?: Actually its still wring, but to tired to try and debug it. (its like midnight here). Yes I am currently staying in Akibara district or something, bouncing off my home machine for english internet (otherwise all I get are alot japanese sites (more annoying then it seems)).

    EDIT?: Sorry was just informed that doesn't make sense, I mean I am using my computer at home in the USA as a proxy for um, my surfing needs, and google and stuff I type in here automatically redirects me to japanese language, and I can't read japanese that well.

    _________________
    Oh this and that.


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sat Nov 01, 2008 1:09 pm 
    Literally Nine
    User avatar
     

    Joined:Tue Mar 01, 2005 9:00 am
    Posts:1263
    Use a different DNS.

    I use one in Los Angeles, since my ISP sucks a lot. Sometimes it fails to resolve such basic things as gmail.com.


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sat Nov 01, 2008 8:51 pm 
    User avatar
     

    Joined:Mon Sep 22, 2008 9:51 am
    Posts:112
    Actually I am about to board my flight home, and i'm not lucky enough to get a flight with inflight wifi. So see you in about 18 hours. I am very glad I didn't have to pay the trip here and back. (it was like 8g roundtrip for just me). I got a new laptop :) (I left mine old one at home due to luggage space issues).

    Anyway, I really wanna know your thoughts on brainfsck. Mostly because it is like a very basic form of asm to me (which is cool).

    _________________
    Oh this and that.


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Nov 02, 2008 11:50 am 
    User avatar
     

    Joined:Sun Feb 12, 2006 8:56 pm
    Posts:1019
    Website:http://eddieringle.com
    Location:Detroit, MI
    My thoughts?

    Ow.

    _________________
    -- Eddie Ringle

    Check out Elysian Shadows and consider backing us on Kickstarter!

    ====================================

    Image


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Nov 02, 2008 12:59 pm 
    Literally Nine
    User avatar
     

    Joined:Tue Mar 01, 2005 9:00 am
    Posts:1263
    Brainfsck is a toy, nothing more. Originally built as a proof of concept; what can be done with very little.

    In truth, everything can be done with BF, but very very slowly. I could also reasonably do all of my coding in logic gate form, but doing so doesn't make a lot of sense either. The expanded assembly instruction sets mean that we can do a lot more in a lot less time. Using BF over other languages defeats this purpose.

    Though, I suppose, it might be one of those things that you want to experience if you wanted to know how difficult coding was. By "was" I mean the times that there was only RAM, no OS, you had to input everything manually with switches, and losing power or flipping a wrong switch meant doing it all over again.

    Or using wires to program, much like the ENIAC (which was the first digital computer ever. Incidentally, the inventor specced out an idea that could have been the first internet iteration; it just didn't end up that way).

    Just because you can do it doesn't mean it's practical. Unless you're doing it to kill time, there's not a lot of other reason.


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Nov 02, 2008 10:18 pm 
    User avatar
     

    Joined:Mon Sep 22, 2008 9:51 am
    Posts:112
    No, its not practical. But learning to do division, multiplication, etc etc, with only loops and iterations is very interesting. I have a part of a bf psudo-c compiler, that compiles a psudo-c style language to bf. Only painful part is preforming bitwidth conversions (multi-cell) and the instruction seperation, due to bf's limitations. But I did the above by hand (otherwise it would of come out correctly). I just find bf interesting because of just how low level it is. I am still working on practical ways to do bitwise and bitshift operations.

    _________________
    Oh this and that.


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Nov 02, 2008 10:47 pm 
    Organ Donor
    User avatar
     

    Joined:Mon Aug 13, 2007 1:47 pm
    Posts:529
    Location:Jawjuh
    My brain is fucked.

    _________________
    Creative people must be stopped! (Latest Entry 7/31/11: "Fishsticks (18+))

    Pleasantville by Night, a humorous horror web RPG


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Jan 18, 2009 5:15 am 
     

    Joined:Sun Jan 18, 2009 4:20 am
    Posts:40
    Ouch.

    That is something I am NOT touching with a ten foot pole.

    That, and Whitespace.

    EDIT: Then again,whitespace might be fun. Imagine including riddles in whitespace in forum posts. Sounds like something up Miah's alley.


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Jan 18, 2009 9:31 am 
    Connoisseur of the Godawful
    User avatar
     

    Joined:Tue Mar 01, 2005 9:00 am
    Posts:456
    ICQ:286315965
    Website:http://rabidtinker.mine.nu/
    Yahoo Messenger:alistair_lynn
    AOL:Agent_Vast@mac.com
    Location:127.0.0.1
    Just because it's turing-complete doesn't mean it's useful.

    _________________
    Alastair Lynn / Alumnus / Onlink Team


    Top
    Offline  
     Post subject:Re: Thoughts on brainfsck?
    PostPosted:Sun Jan 18, 2009 1:08 pm 
    User avatar
     

    Joined:Sat Jun 03, 2006 3:51 am
    Posts:1186
    Website:http://griffinhart.livejournal.com/
    Yahoo Messenger:Squall591
    AOL:FinalWarrior591
    Location:Look at my horse, my horse is amazing!
    Brainfuck is Ada Lovelace's bitch. :mrgreen:

    Anyhow, I have enough trouble recalling C++ while learning Java, I don't expect to be understanding anything Brainfuck-y any time soon. v.v

    -- Griffinhart

    _________________
    "My word is my honor. My honor is my life."
    -- Demonchild, Angelkin, the Blackest Seraph, the Final Warrior

    Image


    Top
    Offline  
    Display posts from previous: Sort by 
    Post new topic Reply to topic

      All times are UTC-05:00


      Who is online

      Users browsing this forum: No registered users and 14 guests


      You cannot post new topics in this forum
      You cannot reply to topics in this forum
      You cannot edit your posts in this forum
      You cannot delete your posts in this forum
      You cannot post attachments in this forum

      Search for:
      Jump to:  
      cron
      Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
      Theme created by Miah with assistance from hyprnova