hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

These Yelps and Squeals are Totally Valid #

by why in bits

Discovered by Jay Phillips, some syntactically correct interrobangling:

 wazup?!!!?!??1:!!??

I love that !!?? can be used as true. Jay is also teaching a free Ruby class at the University of Texas at Dallas. (Seen among the snips.)

said on

Fascinating. I wonder whether there’s an obfuscatory DSL lurking in there somewhere.

said on

Now that is clever.

said on

There’s also a lot of fun to be had with instance variables

party@myhouse
said on

Haha, what a great surprise to check my RSS reader and discover my name’s on the venerable _why’s blog. Thanks for the plug!

While at it, I’d like to encourage everyone in the Dallas area to get in touch with me about my seminar for more information. My email’s admin[at]Jicksta.com. It’s going to be awesome.

Keep up the great work _why. You’re our Ruby Rockstar. :)

said on

But why does ?? eval to 63 ?

said on

and ?! => 33

said on

Because

irb(main):003:0> 63.chr
=> "?" 
irb(main):006:0> ?!.chr
=> "!"

said on

Same reason ?a => 97. To wit.

said on

? is Ruby shorthand for referencing a character.

irb(main):020:0> ?a => 97 irb(main):021:0> ?a == “a”[0] => true

Since ?? equals 63, it is equivalent to true in a boolean test. That means we can negate it with a bang!

irb(main):014:0> ?? => 63 irb(main):015:0> !?? => false irb(main):016:0> !!?? => true

and so on. As always, be responsible ;)

said on
evan: A Convoluted loop to explain ?’s syntax would be

eval("?\\#{??.to_s(8)}").chr
said on

This might be a good ruby quiz idea: Generate a given number is the fewest symbols possible.

said on
!!??  !!!??
true  false

Quick, count the bangs: is this true or false?

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!??
said on

Nick: False!

said on

Nick: False. 41 !s.

said on

Goo! Dear gods of lingo and logic, let us not stray the path to perl-dom…

said on

Ive been using this for ages, check http://www.eachmapinject.com/book/chapters/misc.rb

said on

@mixonic: Too late! We already have the Obfuscated Ruby Contest.

http://iorcc.blogspot.com/

said on

that took some time to understand… parentheses help.

said on

?{*?{%?{-?{**?{+?{||?{|?{&?{&&
?}|?}**?}-?}%?}&&?}+?}*?}||?}&
?[&?[||?[|?[-?[%?[&&?[**?[+?[*
?]|?]*?]&&?]||?]**?]%?]-?]&?]+
?;&?;-?;%?;+?;*?;||?;**?;&&?;|
?:*?:&&?:&?:||?:**?:+?:|?:%?:-
?'-?'&&?'+?'|?'||?'%?'&?'*?'**
?"%?"+?"&?"*?"-?"||?"**?"&&?"|
?/||?/|?/&?/-?/+?/&&?/*?/**?/%
??-??&??&&??||??%??|??*??**??+
?.*?.&?.%?.-?.+?.|?.&&?.||?.**
?,&&?,-?,||?,%?,**?,+?,|?,&?,*
?<-?<+?<&&?<%?<||?<|?<&?<*?<**
?>**?>+?>|?>%?>||?>*?>&&?>-?>&
?=**?=|?=*?=&&?=%?=+?=-?=||?=&
?-&&?-&?-+?--?-%?-|?-**?-||?-*
?+*?+%?+||?+|?+&&?+-?++?+**?+&
?_|?_+?_%?_&&?_||?_&?_*?_-?_**
?)%?)*?)&?)&&?)-?)|?)||?)+?)**
?(%?(+?(-?(**?(*?(|?(&&?(||?(&
?*&&?*+?*-?**?***?*|?*%?*||?*&
?&|?&-?&&?&&&?&%?&||?&+?&**?&*
?^%?^&?^||?^*?^+?^-?^&&?^**?^|
?%*?%+?%**?%||?%%?%&?%-?%&&?%|
?$%?$|?$*?$-?$**?$&&?$&?$||?$+
?#&&?#**?#*?#+?#-?#&?#||?#%?#|
?@+?@%?@&&?@&?@|?@-?@*?@**?@||
?!&&?!||?!&?!**?!*?!%?!|?!+?!-
?~|?~&&?~&?~-?~||?~**?~%?~+?~*
?`&?`||?`**?`*?`%?`&&?`|?`+?`-
?||?|+?|-?|**?|||?|&?|%?|*?|&&
??
=> -114374367934617190099880295228066276746218078451850229775887975052369504785666896446606568365201542169649974727730628842345343196581134895919942820874449837212099476648958359023796078549041949007807220625356526926729664064846685758382803707100766740220839144


YaY! I’ll never miss Perl again!

said on

Someone mind putting some parenthesis on this so that a code newbie can understand? At least I think wazup? is a boolean returning function, but have no idea for the rest of it, unless all that banging is negations… wazup?!!??1

said on DD Mon YYYY at HH:MM

* do fancy stuff in your comment.

PREVIEW PANE