[MPlayer-dev-eng] Quiz

Felix Buenemann atmosfear at users.sourceforge.net
Thu Nov 6 01:18:53 CET 2003


OK,

I dunno why, but I coded this, now find out what it does. That's all you have 
to do.
You get 10l subtracted from your cola account if you win this.
First correctly explained answer wins.

It's probably too lame for real developers, but it's fun :)

---snip---
#!/usr/bin/perl -w
use strict;
#use locale;

sub randomize (@) {
    @_ = split //, shift;
    my ($n, $i, $k, $temp);
    $n = $#_;
    for ($i = $n; $i > 0; $i--)
    {
	$k = int(rand $i);
	$temp = $_[$i];
	$_[$i] = $_[$k];
	$_[$k] = $temp;
    }
    return join('', (@_));
}

while(<>) {
       	s/(\w)(\w+?)(\w)(\W+)/$1 . &randomize($2) . $3 . $4/eg;
	print;
}

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



More information about the MPlayer-dev-eng mailing list