Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

revenge of the python puzzle

4 views
Skip to first unread message

Michal Wallace

unread,
Sep 26, 2002, 12:50:53 AM9/26/02
to

Okay, so you guys think you're so smart. Try this one! No
contest this time, I've learned my lesson. (I suppose if
someone really wants some free hosting bad enough to solve
this puzzle, you could talk me into it, but I'm just posting
this for revenge... Um, I mean "fun".)

If you decode it, see if you can guess what it does before
you run it. Please don't spoil the output for anyone else
who might want to try it... Hint: the earlier thread might
have a clue. :)

wbjig_ucpxmy, kxzp_xzli_h_fmyi \
='ilhg.zuuiyf(ghsp(izwxmyi))',\
"zkvjg wmfi hs sm ajwx vjy"
hv 'h za sazbp': 'hp djsp ahqxp bjy'
"hp's sm ajwx kmbsi pxzy 'xiggm kmbgf'"
"kxc, pxisi yitp ghyis zgamsp gmmo ghoi uibg!"

'kxhgi(<>){wxmau;s/uibg/ucpxmy;ubhyp}';mbzyqis='vbjhp';
ezf="'iyhpgzlm bjmc oyhbf'=qsa;qsa gzemgqtqsa pyhbu";
iaupc="";qgmezg izwxmyi;ilhg=[];

'ejp z siwbip xibi hs hy cmjb bizwx'
zuugis=mbzyqis, "izwxmyi=izwx"
fiv fm(pzso="fm kxzp h zso"):
qgmezg izwxmyi; itiw pzso
"zyf djsp hy wzsi cmj'bi ymp uibugitif,"
kmbsi,ymk = (ezf.sughp('t'),"!")
vmb izwx hy kmbsi:
itiw zuugis[1]
hv izwx hy kmbsi:
fm(wbjig_ucpxmy)

kmbsi = ilhg; "ilhg".sughp().bilibsi()
[izwx.bilibsi() vmb izwx hy kmbsi]
"zyf ymk ki'li bizwxif pxi vhyzg libsi";
azu(fm, azu(iaupc.dmhy, kmbsi))

Cheers,

- Michal http://www.sabren.net/ sab...@manifestation.com
------------------------------------------------------------
Switch to Cornerhost! http://www.cornerhost.com/
Low Priced, Reliable Blog Hosting, With a Human Touch. :)
------------------------------------------------------------


Delaney, Timothy

unread,
Sep 26, 2002, 1:12:27 AM9/26/02
to
May I note of course that I shamelessly stole Holger's code for the basic
framework ;)

Tim Delaney

Delaney, Timothy

unread,
Sep 26, 2002, 1:09:03 AM9/26/02
to
> From: Michal Wallace [mailto:sab...@manifestation.com]

>
> Okay, so you guys think you're so smart. Try this one! No
> contest this time, I've learned my lesson. (I suppose if
> someone really wants some free hosting bad enough to solve
> this puzzle, you could talk me into it, but I'm just posting
> this for revenge... Um, I mean "fun".)

Hmm - a little bit harder. The fake perl actually made it easier though
(gave while and s).

def decrypt(yourstring):
dedict = {
'a': 'm',
'b': 'r',
'c': 'y',
'd': 'j',
'e': 'b',
'f': 'd',
'g': 'l',
'h': 'i',
'i': 'e',
'j': 'u',
'k': 'w',
'l': 'v',
'm': 'o',
'o': 'k',
'p': 't',
'q': 'g',
's': 's',
't': 'x',
'u': 'p',
'v': 'f',
'w': 'c',
'x': 'h',
'y': 'n',
'z': 'a',
}
return "".join([dedict.get(i,i) for i in yourstring])

data = r'''wbjig_ucpxmy, kxzp_xzli_h_fmyi \


='ilhg.zuuiyf(ghsp(izwxmyi))',\
"zkvjg wmfi hs sm ajwx vjy"
hv 'h za sazbp': 'hp djsp ahqxp bjy'
"hp's sm ajwx kmbsi pxzy 'xiggm kmbgf'"
"kxc, pxisi yitp ghyis zgamsp gmmo ghoi uibg!"

'kxhgi(<>){wxmau;s/uibg/ucpxmy;ubhyp}';mbzyqis='vbjhp';
ezf="'iyhpgzlm bjmc oyhbf'=qsa;qsa gzemgqtqsa pyhbu";
iaupc="";qgmezg izwxmyi;ilhg=[];

'ejp z siwbip xibi hs hy cmjb bizwx'
zuugis=mbzyqis, "izwxmyi=izwx"
fiv fm(pzso="fm kxzp h zso"):
qgmezg izwxmyi; itiw pzso
"zyf djsp hy wzsi cmj'bi ymp uibugitif,"
kmbsi,ymk = (ezf.sughp('t'),"!")
vmb izwx hy kmbsi:
itiw zuugis[1]
hv izwx hy kmbsi:
fm(wbjig_ucpxmy)

kmbsi = ilhg; "ilhg".sughp().bilibsi()
[izwx.bilibsi() vmb izwx hy kmbsi]
"zyf ymk ki'li bizwxif pxi vhyzg libsi";

azu(fm, azu(iaupc.dmhy, kmbsi))'''

print decrypt(data)

David Eppstein

unread,
Sep 26, 2002, 2:00:36 AM9/26/02
to
In article <mailman.1033015653...@python.org>,
Michal Wallace <sab...@manifestation.com> wrote:

> Okay, so you guys think you're so smart. Try this one! No
> contest this time, I've learned my lesson. (I suppose if
> someone really wants some free hosting bad enough to solve
> this puzzle, you could talk me into it, but I'm just posting
> this for revenge... Um, I mean "fun".)

I'm not going to spoil this, just point out that my cryptogram applet
http://www.ics.uci.edu/~eppstein/cryptogram/ (sorry, not written in
Python, but Java source available) solves this really easily. You'd
have to make it a lot shorter or a lot less like English to make it
difficult... of course to a human the keywords in the lines with colons
are dead giveaways...

--
David Eppstein UC Irvine Dept. of Information & Computer Science
epps...@ics.uci.edu http://www.ics.uci.edu/~eppstein/

Delaney, Timothy

unread,
Sep 26, 2002, 2:32:19 AM9/26/02
to
> From: David Eppstein [mailto:epps...@ics.uci.edu]

>
> I'm not going to spoil this, just point out that my cryptogram applet
> http://www.ics.uci.edu/~eppstein/cryptogram/ (sorry, not written in

OK - you *gotta* stop case conversions on that thing ...

Tim Delaney

holger krekel

unread,
Sep 26, 2002, 5:24:11 AM9/26/02
to
Delaney, Timothy wrote:
> May I note of course that I shamelessly stole Holger's code for the basic
> framework ;)

that was released into the public domain anyway :-)

holger

Michal Wallace

unread,
Sep 26, 2002, 10:29:06 AM9/26/02
to
On Thu, 26 Sep 2002, Delaney, Timothy wrote:

> > From: Michal Wallace [mailto:sab...@manifestation.com]
> >

> > Okay, so you guys think you're so smart. Try this one! No
> > contest this time, I've learned my lesson. (I suppose if
> > someone really wants some free hosting bad enough to solve
> > this puzzle, you could talk me into it, but I'm just posting
> > this for revenge... Um, I mean "fun".)
>

> Hmm - a little bit harder. The fake perl actually made it
> easier though (gave while and s).


Oh well. :) I think this is just not a good way to make a
python puzzle.

I guess I could avoid all keywords with something like this:

open("/dev/stdout","w").write("hello world")

and then try to make it as convoluted as possible, but then
it's not really cross platform.

Was it obvious what it did? :)

Mark McEahern

unread,
Sep 26, 2002, 11:02:17 AM9/26/02
to
[Michal Wallace]

> Oh well. :) I think this is just not a good way to make a
> python puzzle.
>
> I guess I could avoid all keywords with something like this:
>
> open("/dev/stdout","w").write("hello world")
>
> and then try to make it as convoluted as possible, but then
> it's not really cross platform.
>
> Was it obvious what it did? :)

One man's obvious is another man's enigma. I thought it was a fine puzzle.

Another way to make it harder would be to scramble all characters.

// m

Emile van Sebille

unread,
Sep 26, 2002, 11:51:31 AM9/26/02
to
Mark McEahern

> One man's obvious is another man's enigma. I thought it was a fine
puzzle.
>
> Another way to make it harder would be to scramble all characters.
>

This is the result of the self test I use in my scramble function:


Wkjbj Uqypfu

Fdmnjn Wpxms
(A ykhwneb pwxezmh nu l jiznjmze zinb rsrwfodpxe l zpxstmby.)
Ykhwneb: Hkfy rmymbufkz.
Wpxstmby: Kmymbufkz.
Ykhwneb: Kp, mkqmmq poj nez'b nb?
Wpxstmby: Kqp, 'ynd yprb.
Ykhwneb: Tkk tmbm fu tkmnpoj?
Wpxstmby: Skrm, Y mnqm 'xwp.
Ykhwneb: Op, akfy gku mkk. Lp... ypfep KJV zpxms rwxu'b ypxq?
Wpxstmby: Tmrp.
Ykhwneb: Xqq, ypfiapb ypxq embm. Oumq, eprb rwp ypxq pknus hs nu ypp
ywxmd?
Wpxstmby: A gonw nixeynfu ruh fup yprb nu bmdmjb emxzd 're jmxu iidp fu
iq injy. Zb'd iq dkjenyxwxy fsnunkz yprb ypxq'bm jmzbnu'.
Ykhwneb: Smzbnus?
Wpxstmby: Kqp.
Ykhwneb: Onpm jnbyd?
Wpxstmby: Vfrkydj. Zb'd iq jmmnxm yprb ypxep zpxms rwp mojkbnz' hupmu
ypp inzorsbmtmjenkz yprb ypxq'bm jnbyd. Ohzmbdp ypxnu jm'rdnku
. Yopm gku l zbrwb ypp zpxmre' ymjyxudq yk 'fs rhfib ypp gnxdh fu ypxnu
'nuh mmae. Skg enyuxed ypxnu rbymisye yk gdj gwfq ywxm yk yw
xm. Skyndm yprb ypxq pk jkb zk iidp gdj re... rdhqimb.
(Coro joro... gdrs gdrs gdrs... epfkzp... yphy.)
Ykhwneb: Tmd, jib epj pk ypxq ypnup ypxq'bm jnbyd?
Wpxstmby: Kufbtmu gonw nixeynfu. Oup ypnus ne gku zibm, ypp zpxms ne jkb
l dwxoyibm fm ypp rnu. Ypxq toqm xufwikhe pngmnkhdyq nu ypp
dkisrwrbndxdj znismm rkb fm rmbktnz'. (Coro joro... gdrs gdrs gdrs...
epfkzp... yphy.) Ywfijdp ne, zpxms rwp qmbq pnq. Oudm ypxq am
b ru nyxo nu ypxnu 'xope, ypxwp'd jk zpnmynz' nb.
Ykhwneb: Cib epxwp pnh ypxq amb ypp nyxo?
Wpxstmby: Fwfq Xobkmy. Xm'd yprb ikzb pojnxwfid fm dwxoyibmd, l ddxdxw
zpxms. 'V'd bmrdnbxy yprb l zpxms'd mngm dkjeneye fm zbrupnz'
rwfijy gku l gmg ikjbte ruh ypxu jmnu' xoymz. Kuh yprb'd l pmrwxeznjn
rwfermdb gku ru rqjnynfid zpxms.
Ykhwneb: Vmmd epj pkz'b mkk kizb bmikqm Xobkmy?
Wpxstmby: Cmdohep fm ypp xufwikhe dkiqxwdnrd rkzenhndnbnmd nm 'p
zidkxmpe.
Iknkp Odxw: Kuh eprb xfrkydj rwp ypp dkiqxwdnrd rkzenhndnbnmd fm fdnup
rdnoynfu?

Hmb mkhw nifbxe gwfq WqrwyGhkym - tbys://efg.iczkgb.dk.hz

--

Emile van Sebille
em...@fenx.com

---------

0 new messages