### Re^2: min and mindex

by kcott (Chancellor)
 on Nov 09, 2012 at 06:13 UTC ( #1003072=note: print w/replies, xml ) Need Help??

in reply to Re: min and mindex

++ I like your thinking, jaredor!

So, what's the rules of this drinking game? No doubt I lost points when I failed to utter the incantantion "Schwartzian transform" while coding:

```    my \$min_pos = (
sort { \$a->[0] <=> \$b->[0] } map { [\$_ => ++\$pos] } @array1
)[0];
# do useful stuff
print ... \$array2[\$min_pos->[1]]

OK, I've downed a large Scotch. Your turn. :-)

-- Ken

Replies are listed 'Best First'.
Re^3: min and mindex
by jaredor (Priest) on Nov 10, 2012 at 03:02 UTC

Wait, what?!

*I* don't get to drink because you didn't say the magic words, but *you* do? I need to rethink the rules to this game....

... but then it is a technical fault that I didn't grok that at the core of your masterful schooling on question posting, problem analysis and solution testing was The Schwartzian ... so okay, I owe you a point or a pint, whichever you prefer.

Actually, you caught me in a minor sin, since I think "reduce" (++tinita) would be what I would use for the problem as stated (sort of like spinning a log on a lathe to get a toothpick). So I posted an answer which wasn't a great answer for the question, but allowed me to be a wee bit cheeky for my own amusement.

The "drinking game" is just something I do to keep myself engaged with the site content and is just a variant of what some people do to keep awake in meetings: See if you can predict a response. Successful prediction? Assess whether it was necessary or gratuitous. Gratuitous? Point! Take a drink. For PM my rubric is

1. Is the answer not wrong, but not quite right?
2. Could the answer have been relatively easy to demonstrate with code, but wasn't?
3. Does the answer seem to be more of an homage to the hive mind rather than a sincere effort to educate or illuminate?

(Now you see why I felt compelled to add working code to my snarky comment.)

This game is not for everyone: According to a thread I read a while back, sundialsvc4 would have destroyed BrowserUK's liver years ago. ;-)

Create A New User
Node Status?
node history
Node Type: note [id://1003072]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2018-03-24 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
When I think of a mole I think of:

Results (297 votes). Check out past polls.

Notices?