[MPlayer-dev-eng] Quiz [OT]

Felix Buenemann atmosfear at users.sourceforge.net
Fri Nov 7 19:10:21 CET 2003


On Friday 07 November 2003 10:40, Jonas Fällman wrote:
> I sent a really strange version, I noticed a lot of weird things in it
> after I sent it (as did you). Here is a better, or at least much shorter
> version, haven't done any speed checking on it (but it should be much
> slower than all the other version.. but my goal was shortness and not
> speed..
>
> while(<>){s|\b(\w)(\w{1,})(\w)\b|$a=$1;$b=$2;$c=$3;for$d(0..99){$l=int(
> rand(length$b));$b=~s/(.{$l})(.)/$2$1/};$a.$b.$c|eg;print}
>
> all this in only 129 chars :)
yea, that one works nicely and is pretty short, speed is not the best (5000% 
slower ;-)

OK, I think we should stop this thread or someone will start throwing stones 
after us for polluting the list!

> /tarp

-- 
Best Regards,
        Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________

---jonas new code---
#!/usr/bin/perl -w
use strict;
#use locale;

while(<>){
    s|\b(\w)(\w{1,})(\w)\b|
	my ($a, $b, $c) = ($1, $2, $3);
	for (0..99){
	    my $l = int(rand(length $b));
	    $b =~ s/(.{$l})(.)/$2$1/;
	}
	$a.$b.$c
    |eg;
    print;
}

---jonas new code---




More information about the MPlayer-dev-eng mailing list