Welcome to the Monastery PerlMonks

### just the average code

by mk. (Friar)
 on Jan 19, 2006 at 21:01 UTC Need Help??

it's actually a very simple code (as you can tell), but my first one here, so let's pretend it's a big deal, ok?! j/k hehe
=)

perl -e '\$_=abs(sin(307));s/3|\.//g;\$b=\$_;\$_=substr(atan2(1189,6823),2,8);eval"y/0-9/\$b/";for(\$c=0;\$c<5;\$c++){print chr(substr(\$_,0,2));s/^..//;};'

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
grrr.... argh!

Replies are listed 'Best First'.
Re: just the average code
by jdalbec (Deacon) on Jan 20, 2006 at 02:41 UTC
If you don't care about the final \0, you can golf the for loop to print chr for m/(..)/g. How did you discover 307, 1189, and 6823?
thank you, hadn't thought of that!
=)

for the numbers, they were actually (kinda) randomly chosen: i needed 7, 4, 6, 5, 8 and 2, and somehow i realized sin of 307 would fit; then i just searched for any arctangents that would possibly have the sequence 17253098 - and found!
perl -e 'for (\$x=0;\$x<10000;\$x++){for (\$y=0;\$y<10000;\$y++){print "(\$x,\$y) >>". atan2(\$x,\$y)."\n" if atan2(\$x,\$y)=~/17253098/}}'

that took me about two minutes while i was at work doing nothing, so i guess they were well spent.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
grrr.... argh!
Re: just the average code
by Mago (Parson) on Jan 20, 2006 at 10:36 UTC
```perl -le '\$_=abs(sin(307));s/3|\.//g;\$b=\$_;\$_=substr(atan2(1189,6823),
+2,8);eval"y/0-9/\$b/";for(\$c=0;\$c<5;\$c++){print chr(substr(\$_,0,2));s/
+^..//;};'

*<;-))

Mago
mago@rio.pm.org

Create A New User
Node Status?
node history
Node Type: obfuscated [id://524348]
Approved by McDarren
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2019-08-19 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
If you were the first to set foot on the Moon, what would be your epigram?

Results (138 votes). Check out past polls.

Notices?