A quick one-liner
No replies — Read more | Post response
|
by liverpole
on Jun 11, 2018 at 20:19
|
|
|
Should work on most *nix systems:
perl -E'say`$^Xdoc -qj`=~m`"(.*)"`'
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
|
Happy birthday, happy birthday... happy birthday to Perl!
1 direct reply — Read more / Contribute
|
by Discipulus
on Dec 18, 2017 at 02:49
|
|
|
#
###
##0##
###
#
;while(
#=30==#
<DATA>)
{chomp;
s{#}{}g
#==30=#
;3;s{0}
{\n}g;;
#=30==#
;s{\d}{
" "x $&
}xge;print}BEGIN{print$/,(" "x14),(join" - ",(
map{join" ",(split/\s/,scalar gmtime$_)[1,2,4]
}566784000,1513555200)),$/};END{seek DATA,0,0;
print" "x 4,$_ while<DATA>}30;30;__DATA__###30
9_2_2_7_2_7_2_2_2_108|_||_1|_|1|4_||1|2\1/|_1|
#_||_||_108|2|_1|1\1|_3_||_|3/1|_1|1||1\1_|10#
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
|
Langton's Obfuscation
No replies — Read more | Post response
|
by golux
on Oct 29, 2017 at 01:22
|
|
|
After watching this very interesting video, I decided it just had to be made into an obfuscation. After completion I realized it had been more than a year since I had composed one -- time flies. As usual, more information can be found at Wikipedia.
You'll need to have perl/Tk installed to run it. Invoke it with perl <program> (or in Windows give it a .pl extension). I won't give away too much, except to say that the shape of the code hints at the ultimate outcome.
When first run, type the <space> key to start progress. You can then type <space> again to pause or restart. The number of "cycles" (or "generations") displays in the invoking window after each subsequent pause.
Two parameters may be given; both are optional.
The first is an integer that says how many "cycles" to run before changing colors. It defaults to a value which is more obvious when you run the code. Try for example a value of '350'.
The second is the delay in milliseconds between successive "cycles"; use a larger value to slow down execution. The default is '1' (fastest possible).
s""v
tf!Ul
<)%c-
%e-%y
-%z-
%l-% d*>)
1-3-4 1-34-
1-(g1 1(*<%
p>tij gu}}2
1111 <%E>t
ijgu }}2<
%N>Nb joXjo
epx.? ofx)*
<%N.? ujumf
)rr| #Mbo
hupo (t!B
ou#~* <%w>%
N.?Db owbt)
.xj>? 911-.
if>? 623*
.?qb dl<n bq|% w.?d
sfbuf Mjof) 9+%`- 1-9+%
`-623 *<%w. ?dsfb ufMjo
f)1-9 +%`-9 11-9+ %`*~)
2//: :*<' `''% N.?c
joe) #=tq bdf? #>?t
vc|,, %c&3} }qsjo u#Dpv
ou;%l ]o#~* <tvc! s|sbo
e)27* ~tvc! `|%w. ?efmf
uf)% t*<% t>%w .?ds
fbuf Sfdu bohm f)d)
(111( **~tv c!d|) 9+%y.
5-9+) 75.%z *.5-9 +%y,5
-9+)7 5.%z* ,5-.g j>?di
s)46 */%` [1^* ~%N.
?sfq fbu) %E>?
tvc|j g)%c& 3''%l
,,=23 81:*| %j>21
1+%z, %y<%g >%g[%
j^<% f>%g @.2;
2<%w .?ef mfuf
)%g*< %g[%j ^>%g@
(1(;% w.?ds fbuf
Pwbm) d)%d* *<%e&
3boe %z,> %e=3
@.%f ;%f< %e&3
ps%y, >%e@. %f;%f
<%e>) %e,%f *&5<'
`<%l& %p!ps %d>tq
sjou g(&y &y&y
(-'s
-'s-'
s~~*<
%N.?N
bjoMp
pq";s,\s,,g;s;([^[]);chr(ord($1)-1);ge,eval
say
substr+lc crypt(qw $i3 SI$),4,5
|
Predecrement a constant?
1 direct reply — Read more / Contribute
|
by monsoon
on Feb 28, 2017 at 02:14
|
|
|
Not much obfuscation really. The idea was to try and see if it was possible with some unusual code to predecrement a constant or at least to pretend to do so.
*0=sub:
lvalue
{my$l},
print
--0
->(!0)
|
Dungeons and Dragons die roller (Golf)
4 direct replies — Read more / Contribute
|
by zsl
on Sep 30, 2016 at 16:18
|
|
|
60 byte solution, not counting hashbang, to take strings that look like '2d4' or '2d4+10' and give you the result:
-n
($d,$s,$=)=split/d|\+/;$=+=1+rand $s for 1..$d;print$=,$/
Anyone wants to try and beat my record?
|
Another japh
No replies — Read more | Post response
|
by Mandrake
on Aug 03, 2016 at 21:43
|
|
|
Had a bit of spare time today !
{sub OrO{OrOOr
(eval(chr(@_[0])))}}push @Or,++$_
for(0..(++$_*++$_)*++$_);{sub OrOOr{print@_[0]}}
OrO(Or(Or0()+1+Or0(),Or0()+1))&&OrO(Or(Or0()+Or0(),
Or0()+Or0()/(Or0()-2)))&&OrO(Or(0,(Or0()*(Or0()-1)
-1)))&&OrO(Or(Or0()*2+1,(Or0()*2+1)/(Or0()-1)));sub
Or{$Or[@_[0]].$Or[@_[1]]}sub Or0{$_=
"\[\[\[\[";$_=((split//));}
|
Self-constructing Japh
1 direct reply — Read more / Contribute
|
by golux
on Jul 30, 2016 at 17:37
|
|
|
It's been a while. Here's an obfuscated script written over 4 years ago that finally got finished up.
Though it technically works in Windows with "perl -MWin32::Console::ANSI <script>", it looks much better in Linux or MacOS (or probably Cygwin), for which it was designed, as it uses ansi escape sequences.
Note: to change the speed give an optional delay argument in fractions of a second. The default is 0.1 (ie. 0.5 would be slower, 0.05 faster).
die+eval(q{$|=pr int"\e[ 2J\n";$k=' |';s ,,2
220;3500731;352273 5071;16007150 74;1622713,x;y; 0-4;8| _/%;;s
;5;\e[103m;g;s,6, \e[102m,g;s;7;\e [m;g;$/=$_;$_=q| hb2Gbb 5hhDei
4dh0Bh lFbi20 1hoC4d o0CdsB bp201h vDev5d v0ChzG
|;s;[1 -9];>$&;g;s;[A-I ];^$&;g;y|A-I|1- 9|;{s;^(\w)(\w);
;x?($y =-97+ord$1,$x=-9 7+ord$2):s,^0,, ?$k='/':s,^([>^]
)(\d), ,?map{$c=$1,$X=1 +3*$x,$Y=$y* 2,$Z=4;$"=$/=~s;
%;$k;r ;map{p rint"\ e[${\$Y ++};${ X}H$_"
;$X--if++$ Z<7}sp lit';' ,$";$k= '|';se lect$J
,$a,$p,$ARG V[0]|| .1;'^' eq$c?$y --:$x+ +}1..$
2:last;redo }}=~y %8 \n % %dr), "\e[". "22H\n"
say
substr+lc crypt(qw $i3 SI$),4,5
|
Having fun with ambiguity
No replies — Read more | Post response
|
by trizen
on May 23, 2016 at 14:30
|
|
|
print $$ /0; # a legit division by zero
^....super....^
^....black....^
^....magic....^
|(?{m}(?{"\[\[\)
\.\\\|\`\]\[\[\{
\[\.\@\/\(\^\.\[
\{\;\\\,\[\@\:\?
\+\^\)\("=~s\}[\
\s]\}\}rg^"\+\)\
\@\@\(\^\*\(\(\/
\[\:\@\/\[\@\;\\
\{\+\^\.\@\{\(\[
\\\@\;\[\"\""=~s
\}\s\}\}gr\})},s
\/\/$^R\/esex})|
^....hugs....^
^.....&&.....^
^...kisses...^
//
//xo//xo//xo//xo//xo//xo//xo//
//
|
Test Post to check new edit feature
1 direct reply — Read more / Contribute
|
by LanX
on Mar 10, 2016 at 17:14
|
|
|
If you are a cabal and want to test jdporter's new edit/update button reply in this thread. We can delete later again.
|
Using the olde times internet
3 direct replies — Read more / Contribute
|
by lemonCurd
on Feb 14, 2016 at 09:45
|
|
|
I'm contemplating about this very little piece of Perl code. I'm already more than a little bit proud of it, but I wondered if the venerated Monks had suggestions to make it even shorter:
print"@ARGV"=~s|.|$_=2+index'temaniowkugrdsXjyüqäxvöpcfzlbh',lc$&;$Q=
1.45*log;$_-=1<<$Q;for($O='';--$Q>0;$_/=2){$O.=chr$_%2+45}"$O "|ger
Try it with some text as command line arguments.
Especially I'm curious about:
- Is there any way to avoid initializing $O?
- I use $Q=1.45*log to approximate the number of bits in $_. Any shorter way?
Every comment is very much appreciated!
2/15/2016: Corrected two typos!
|
|