Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: (Golf) Nearest Neighbors

by thospel (Hermit)
on Oct 27, 2003 at 19:28 UTC ( #302483=note: print w/replies, xml ) Need Help??


in reply to Re: (Golf) Nearest Neighbors
in thread (Golf) Nearest Neighbors

Just saw this thread. Here is a destructive (only works once) solution at 46:

sub nn{$a|=$"x$_.1for@_;$b.=$"until$a=~/1$b(1)/;@a=@-}

Replies are listed 'Best First'.
Re: Re: Re: (Golf) Nearest Neighbors
by thospel (Hermit) on Oct 27, 2003 at 19:34 UTC
    Ah, I should think a bit more before submitting. Here is a 44 (and I should also mention it only works for smallish natural numbers, all different and at least 2 arguments):

    sub nn{$a|=2x$_.3for@_;$b.=2until$a=~/3$b(3)/;@a=@-}

    The need for the assign is a perlbug, otherwise it would be 41

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://302483]
help
Chatterbox?
[Corion]: choroba: I'm still using spod5 as my pod-to-ooxml- converter didn't really get off the ground so far
[choroba]: Slidy is basically HTML, so I'm not sure I really fly high :)
choroba should make his presentation scaffolding public
[Corion]: choroba: spod5 converts pod to S5 HTML, so it's also still basic. I find the lack of animations (in the sense of "highlight this", "highlight that" in code) somewhat tedious as I do it with rendered PNGs
[Corion]: I haven't found a good way to include/use the source SVGs I use for creating the PNGs directly as animations
[ambrus]: Presentations come in many different shapes, and so slides do as well.
[Corion]: Doing that in Powerpoint or Ooxml would be nice(r) but I'm much quicker doing the outline of a presentation and the code as Pod
[Corion]: Hurrr - on a machine that is behaving weirdly, I have two processes CROND running. I guess that is the source of unattended jobs sometimes not finding their files anymore...
[ambrus]: Most of the time if I make slides, they're just a formatted document with a medium level of formality (between a well written article and an informal draft), with usually the page breaks chosen carefully and possibly some content repeated between pages.

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-09-26 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (293 votes). Check out past polls.

    Notices?