ROT13(g(2307534882734083072Y,1,0).pbz)

Discussion in 'Java' started by thor, May 29, 2008.

  1. thor

    thor Guest

    private static void t(long a, int b, int c)
    {
    if ((a & 1) > 0)
    {
    System.out.print((char)('`' + c));
    b = (((a >>=1) & 1) > 0) ? -b : b;
    }
    else if (a == 0) return;

    t(a >> 1 , b, c + b );
    }
     
    thor, May 29, 2008
    #1
    1. Advertising

  2. thor

    Daniel Pitts Guest

    thor wrote:
    > private static void t(long a, int b, int c)
    > {
    > if ((a & 1) > 0)
    > {
    > System.out.print((char)('`' + c));
    > b = (((a >>=1) & 1) > 0) ? -b : b;
    > }
    > else if (a == 0) return;
    >
    > t(a >> 1 , b, c + b );
    > }

    And the point of that little exercise? BTW, tail recursion can be
    replaced by a loop.

    --
    Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
     
    Daniel Pitts, May 29, 2008
    #2
    1. Advertising

  3. > And the point of that little exercise?
    JarPit.
     
    Sébastien de Mapias, May 29, 2008
    #3
  4. thor

    Daniel Pitts Guest

    Sébastien de Mapias wrote:
    >> And the point of that little exercise?

    > JarPit.
    >
    >

    Yes, thats the same result I got, but I wanted to know the "point" of
    it? As far as challenges go, it was lame. As far as advertisements go,
    it was lame. As far as sites go ...

    --
    Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
     
    Daniel Pitts, May 29, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eirik

    Why does this work? (rot13 function)

    Eirik, Dec 16, 2003, in forum: C Programming
    Replies:
    15
    Views:
    813
    Randy Howard
    Dec 18, 2003
  2. Andy Dingley

    rot13 in a more Pythonic style?

    Andy Dingley, Feb 14, 2007, in forum: Python
    Replies:
    19
    Views:
    558
    Andy Dingley
    Feb 16, 2007
  3. Agent Spikes

    Shorter Rot13 Pure-C Implementation

    Agent Spikes, Mar 7, 2010, in forum: C Programming
    Replies:
    19
    Views:
    928
    Michael Foukarakis
    Mar 17, 2010
Loading...

Share This Page