anybody willing do some golfing?
[email protected] (Hubert depesz Lubaczewski)
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
hi,
last week we started polish golf on newsgroup pl.comp.lang.perl.
tommorrow it will be over, but i thought that perhaps some of you would
be interested in it.
if so - please dont check pl.comp.lang.perl (it is in polish, but
solution will be pure-perl :).
rules:
you have to write a program, which will be passed two strings. message
and password.
passed - as arguments:
perl script "message" "password"
message will match /^.{1,10000}$/;
and password will match /^[a-z]{1,10000}$/
now. you have to modify password, but hashing it's letters in this way:
"abcdef" becomes "acefdb"
"abcde" becomes "acedb".
it is: every odd letter from first to last, and then every even letter
from last to first.
now you have to make xor of message with created password repeating
password as needed (for example: given message "hubert lubaczewski" and
password "abcde" you have to xor "hubert lubaczewski" and "acedbacedbacedbace".
if password is longer then message - you use just first characters of
password.
next the created encrypted message has to be converted to hex (as
sprintf("%02x") does), and printed backwards (i.e. bytes, not hex
values).
example:
script "hubert lubaczewski" depesz:
0c0e0904151e060418061c4411171f11050c
at the end of output string you have to give "\n".
that's all.
if there will be any doubt i can post test script (1700 bytes).
but please. if you'll write something for this contest - please dont
write solutions here. just a score (counted as typical perl golf
scoring).
best regards
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię, że naprawdę mam
coś do powiedzenia. (c) 1998 depesz
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux) iD8DBQE9uGO1KBwKA0prOAkRAkRVAJwKvHenchYHLoSav+jY0GM7yxD+nACgkhEo 2GAQkoGP0Q7KmU9lHomwzDk= =IJMB -----END PGP SIGNATURE-----