Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:03:27+00:00 2026-05-25T06:03:27+00:00

I was working through the 160 byte BrainFuck code trying to figure out what

  • 0

I was working through the 160 byte BrainFuck code trying to figure out what things do, and I cant seem to figure out what 1[d=b] does.

s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17
?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;}

Heres the code, its about midway through the first line
http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c

I’m not asking what it does in that context but what 1[] does in the first place.

Thanks =)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:03:28+00:00Added an answer on May 25, 2026 at 6:03 am

    In C, there is no difference between x[7] and 7[x]. They both equate to *(x+7) (and *(7+x) since addition is commutative) which means the seventh element of the x array.

    In this particular case (1[d=b]), you first assign the current value of b to d, then calculate 1[d] which is the same as d[1].

    By doing it this way (offset[base] rather than base[offset]), it allows you to combine it with the assignment, otherwise you’d need:

    d = b; char *v = d[1];
    

    I suppose I shouldn’t need to tell you that this is actually very bad code, as evidenced by the fact that you have to think very hard about what it means. Better code would be almost instantly decipherable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working through the NerdDinner Tutorial , I'm trying to figure out a good way
I am working through the Stanford iPhone class and I can't figure out why
I'm working through previous years ACM Programming Competition problems trying to get better at
Working through a sample in Chapter 3 of Programming in Scala, the following code
Working through C++ Primer Plus and am trying to cin data to a dynamically
After working through the Django tutorial I'm now trying to build a very simple
So I'm working through the code in this tutorial which has a small button
Working through Pro ASP.NET MVC book and I got the following code snippet that
I am working through an MVVM tutorial, and I have the following code, written
I am working through a code sample, and I just want to hear some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.