Gossamer Forum
Home : General : Perl Programming :

Let's have a little fun...

Quote Reply
Let's have a little fun...
Ok, a friend and I have been have been sending each other stupid/obnoxious messagaes, encoded in ord values (for no particular reason). His coworker wanted to see if I could decipher a message that was ord encoded many levels deep. This is the message he sent me.

Code:
53:54:58:53:49:58:53:56:58:52:57:58:52:57:58:52:57:58:53:56:58:53:49:58:53:4
8:58:53:56:58:53:53:58:53:53:58:53:56:58:53:55:58:53:53:58:53:56:58:52:57:58
:52:57:58:53:50:58:53:56:58:52:57:58:52:56:58:53:53:58:53:56:58:53:50:58:53:
50:58:53:56:58:53:49:58:53:48:58:53:56:58:52:57:58:52:56:58:53:49:58:53:56:5
8:52:57:58:52:57:58:53:53:58:53:56:58:52:57:58:52:56:58:52:57:58:53:56:58:52
:57:58:52:57:58:53:51:58:53:56:58:52:57:58:52:57:58:53:51:58:53:56:58:53:49:
58:53:48:58:53:56:58:52:57:58:52:56:58:53:50:58:53:56:58:52:57:58:52:57:58:5
2:57:58:53:56:58:52:57:58:52:57:58:53:55:58:53:56:58:53:49:58:53:48:58:53:56
:58:52:57:58:52:56:58:53:55:58:53:56:58:53:55:58:53:53:58:53:56:58:52:57:58:
52:57:58:52:56:58:53:56:58:52:57:58:53:48:58:52:57:58:53:56:58:53:49:58:53:4
8:58:53:56:58:52:57:58:52:57:58:53:52:58:53:56:58:52:57:58:52:56:58:53:51:58
:53:56:58:52:57:58:52:56:58:53:55:58:53:56:58:52:57:58:52:56:58:52:57:58:53:
56:58:52:57:58:52:57:58:53:51:58:53:56:58:53:49:58:53:48:58:53:56:58:53:53:5
8:53:49:58:53:56:58:53:49:58:53:48:58:53:56:58:52:57:58:52:56:58:52:57:58:53
:56:58:52:57:58:52:57:58:52:56:58:53:56:58:53:55:58:53:55:58:53:56:58:52:57:
58:52:57:58:52:57:58:53:56:58:52:57:58:52:56:58:52:56:58:53:56:58:52:57:58:5
2:56:58:52:57:58:53:56:58:52:57:58:52:56:58:52:56:58:53:56:58:53:49:58:53:48
:58:53:56:58:52:57:58:52:57:58:53:52:58:53:56:58:52:57:58:52:56:58:53:50:58:
53:56:58:52:57:58:52:56:58:53:51:58:53:56:58:52:57:58:52:57:58:53:51:58:53:5
6:58:53:50:58:53:52:58:53:56:58:53:49:58:53:48:58:53:56:58:53:49:58:53:48:58
:53:56:58:53:53:58:53:51:58:53:56:58:52:57:58:52:57:58:53:53:58:53:56:58:52:
57:58:52:56:58:52:56:58:53:56:58:52:57:58:52:57:58:52:57:58:53:56:58:52:57:5
8:52:57:58:53:51:58:53:56:58:53:49:58:53:48:58:53:56:58:52:57:58:52:57:58:53
:52:58:53:56:58:52:57:58:52:57:58:52:57:58:53:56:58:53:49:58:53:48:58:53:56:
58:52:57:58:53:48:58:52:57:58:53:56:58:52:57:58:52:57:58:52:57:58:53:56:58:5
2:57:58:52:57:58:53:53:58:53:56:58:53:49:58:53:48:58:53:56:58:52:57:58:52:56
:58:53:51:58:53:56:58:52:57:58:52:56:58:53:48:58:53:56:58:53:49:58:53:48:58:
53:56:58:52:57:58:53:48:58:52:57:58:53:56:58:52:57:58:52:57:58:52:57:58:53:5
6:58:52:57:58:52:57:58:53:53:58:53:56:58:53:49:58:53:48:58:53:56:58:53:55:58
:53:55:58:53:56:58:53:55:58:53:53:58:53:56:58:52:57:58:52:57:58:52:56:58:53:
56:58:53:49:58:53:48:58:53:56:58:52:57:58:52:57:58:53:52:58:53:56:58:52:57:5
8:52:56:58:52:57:58:53:56:58:52:57:58:52:56:58:53:54:58:53:56:58:52:57:58:52
:56:58:53:54:58:53:56:58:53:49:58:53:48:58:53:56:58:52:57:58:52:56:58:53:55:
58:53:56:58:52:57:58:52:56:58:52:57:58:53:56:58:53:49:58:53:49:58:53:56:58:5
3:49:58:53:48:58:53:56:58:53:49:58:53:48:58:53:56:58:53:51:58:53:54:58:53:56
:58:53:49:58:53:48:58:53:56:58:53:50:58:52:57:58:53:56:58:52:57:58:53:49:58:
53:56:58:52:57:58:52:56:58:53:56:58:52:57:58:53:49:58:53:56:58:52:57:58:52:5
6:58:53:56:58:53:53:58:52:57:58:53:56:58:52:57:58:52:57:58:52:57:58:53:56:58
:52:57:58:52:57:58:52:57:58:53:56:58:52:57:58:52:56:58:52:56:58:53:56:58:53:
49:58:53:48:58:53:56:58:52:57:58:52:56:58:53:54:58:53:56:58:52:57:58:52:57:5
8:53:53:58:53:56:58:53:55:58:53:55:58:53:56:58:52:57:58:52:56:58:53:53:58:53
:56:58:53:49:58:53:49:58:53:56:58:52:57:58:53:49:58:53:56:58:52:57:58:52:56:
58:53:56:58:53:50:58:53:51:58:53:56:58:52:57:58:52:57:58:53:52:58:53:56:58:5
2:57:58:52:56:58:53:50:58:53:56:58:52:57:58:52:56:58:52:57:58:53:56:58:53:49
:58:53:48:58:53:56:58:52:57:58:52:56:58:52:56:58:53:56:58:52:57:58:52:57:58:
52:57:58:53:56:58:52:57:58:52:57:58:52:56:58:53:56:58:53:55:58:53:55:58:53:5
6:58:52:57:58:52:57:58:52:57
Simple enough to decode, but I'd like to see the solutions you guys can come up with to do it. Not counting placing the above code into a string, I got the algorithim down to about 3 lines (and then further down to one line, with obfuscation).

So, let's see how you guys do with it? Again, it's just ordinal values, done multiple times. I don't care if your solution is many lines of code, I just wanna see how everyone goes about it. I'll post mine after we've seen a few other ones.

Gordon, you're excluded since I already showed you my solution. Wink

Alex, I'd be particularly interested to see your approach.

So let's see what everyone's got!

--Mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
Quote Reply
Re: Let's have a little fun... In reply to
Aw c'mon! No one wants to play?

to go from ord value back to it's original charatcer:

print chr($ord_val);

Someone play along! Elliot? JPDeni? Smile

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.
Quote Reply
Re: Let's have a little fun... In reply to
How about if i use a different method?

2 lines of code down to 1 with obfuscation:

s/\s//g+s/(\d+):/chr($1)/eg while (/\d+:/);print;

-- Gordon



s/(\d{2})/chr($1)/ge + print if $_ = '8284703280698276687967';
Quote Reply
Re: Let's have a little fun... In reply to
Right on, worked even better than mine! Can be condendsed and obfuscated further as:

s;\s;;g+s;(\d+):;chr$1;egwhile m;\d+:;;print;

Smile

My original used recursion:

s;\s;;g;print a($_);sub a{my$m;$m.=chr for split m;:;,shift;$m=~m;\d:\d;?a($m):return$m;}

You win the golf game :)

--mark

Installation support is provided via ICQ at UIN# 53788453. I will only respond on that number.