Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal Rupert's Journal: Bug fix to sig 10

GCC didn't like my sig. Thanks to lemonjus and jungd for pointing this out.

New sig:

--
int x=354583890,y=43836;main(){putchar(x);x>>=y&7;y>>= 3;return y?main():0;}

This discussion has been archived. No new comments can be posted.

Bug fix to sig

Comments Filter:
  • Rupert, I'm curious how putchar works to print a single character with this big int. I'm re-learning C, and I can't find this explained anywhere. can you email me?

    spam1@sonous.com

    thanks!
    • right, replying to myself in someone else's journal...

      it's the last 7 bits of that number that putchar, or printf, or whatever print function spits out, so even though it's a big binary number, the app doesn't care, and just chops off the first 7 bits to use them as the character.

      did you come up with this yourself?

      -lev
      • did you come up with this yourself?

        [ Rupert, have you ever actually been to England? :-) ]

        lev, to answer your question, I can attest to the fact that Rupert is indeed clever enough to have come up with this on his own. That's the fun of .sig programs -- thinking of a clever trick to use for compression, and/or using the side effects of a function or compiler instruction for your own purpose. And recursion is always fun... The arbitrary limit of 120 bytes helps make it a bit of a challenge.

  • i figured out how you do it, here are my numbers!

    x=1317720403
    y=326114

    x contains the characters, y contains the number of bit shifts

    i did my calculations using python and a calculator, i never knew you could package up an list of numbers into one number using AND and bit shifts, very interesting :D

    >>> rupert(354583890,43836)
    R (X = 354583890, Y = 43836, Y&7 = 4)
    U (X = 22161493, Y = 5479, Y&7 = 7)
    P (X = 173136, Y = 684, Y&7 = 4)
    E (X = 10821, Y = 85, Y&7 = 5)
    R (X = 338, Y

    • You're welcome. I think the objective of good .sigs is to make the world a better place. Clearly mine has succeeded.
  • I was inspired by your sig to do something similar for my own.

"Gravitation cannot be held responsible for people falling in love." -- Albert Einstein

Working...