Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Re: (Golf) Kaprekar's Process

by dimmesdale (Friar)
on Jun 17, 2001 at 06:05 UTC ( #89119=note: print w/replies, xml ) Need Help??

in reply to Re: (Golf) Kaprekar's Process
in thread (Golf) Kaprekar's Process

That's odd...I tried running this on my system. First I just did the map statement, and assigned 123 to x. This worked perfectly. So, I got a little confused as to why it worked for me, and not for you, so I tried to run the whole script. However--and this is quite a big however--it resulted in an infinite loop, printing out large, negative numbers on my machine. Is this the exact code?

Replies are listed 'Best First'.
Re: Re: Re: (Golf) Kaprekar's Process
by mr.nick (Chaplain) on Jun 17, 2001 at 08:11 UTC
    Oh, it loops indefinately, all right. I ran it | head. And yes, that is the exact code.

    If you grab the top of the output, do the see the odd value of @_ = 312321,123312? I would think that @_ would contain the same value as the output from c() since it uses the same map statement (- the pop). But I can't shake the feeling I'm missing something simple here (as I often do) :)

    Btw, I split the subroutine up into individual statements for debugging. It used many fewer temporary variables at first.

    mr.nick ...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://89119]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2020-11-30 05:37 GMT
Find Nodes?
    Voting Booth?

    No recent polls found