Brainf*ck has 8 operations:
BF equivalent in C + *p++ - *p-- > p++ < p-- [ while (*p) { ] } . putchar(*p) , *p = getchar();
Using these, how does one figure out if X is less than Y? (Feel free to express you answer in Perl, but be sure you use nothing more than this operations.)
Updated
sample BF code to put 50 in slot 0 + add 1 to slot 0 > move to slot 1 +++++++ add 7 to slot 1 [ while slot 1 is not 0 < move to slot 0 +++++++ add 7 to slot 0 > move to slot 1 - subtract 1 from slot 1 ] < move back to slot 0


japhy -- Perl and Regex Hacker

In reply to Brainf*ck Question by japhy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.