Results 1 to 2 of 2

Thread: This block of code doesnt make sense!!

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Location
    Indiana
    Posts
    73

    Question This block of code doesnt make sense!!

    Code:
    for( i=1,d=c; i && *c; c++ )
       i+=*c=='[', i-=*c==']';
    if(!i) {
       c[-1]=0;
       while(a[p])
       {
          interpret(d);
       }
       c[-1]=']';
       break;
    }
    This is C code for an interpreter for the Brainf*** language, and [ is the beginning of the looping structure. I am making a superset to the language, called TripleHack, but I NEED to understand this looping structure. I can't figure out what this does! The code is in the middle of the interpret function. I took out all the unnecessary stuff.

    Thank you


    It is said that the only language all programmers understand is profanity.
    Last edited by TadaTensai; Jun 3rd, 2001 at 03:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width