Now that I've taken a closer look, this is the shortest iterative version I could find (and also the shortest I could make it and have it run under strictures and warnings, although those aren't really prerequisites
in golf):
sub indexArray3{
1while$_[0]ne pop;$#_
}
I'd say that's pretty obfuscated, too. It can be done
in a couple fewer characters recursively, if you use a one-character subroutine name and eliminate any unnecessary whitespace. I'd like to know hoe to do it in fewer iteratively, but I just can't figure anything out. Please point it out to me if there's a way.
Chris Stith | [reply] [d/l] |
| [reply] |
Apology accepted. In golf, I like to play with what the
parser recognizes with whitespace and without.
I'll try to credit other people from now on when I use
their ideas. I thought the thread was short enough that
it would be obvious where the idea was from. I don't
intend to steal ideas, just borrow. I'll make it more
clear that's what I'm doing.
BTW, I'm not fond of trolls, either. You can find me
remarking on such osts over on clpmisc quite a bit.
Come to think of it, you can find me on clpmisc quite
a bit in general.
Chris
BTW, here's my first JAPh, just so there'll be some
code in my node. Comments welcome.
$z = int(rand(1000)+1); $y = 'reverse ' x $z;
eval eval qq{$y "@{['\"n\\\\.rekcaH','lreP','rehtonA','tsuJ\"','tnirp'
+]}"}
| [reply] [d/l] |