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 02 Oct 2006 at 10:33

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

said on 02 Oct 2006 at 10:51

Now that is clever.

said on 02 Oct 2006 at 10:57

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

party@myhouse
said on 02 Oct 2006 at 11:08

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 02 Oct 2006 at 11:12

But why does ?? eval to 63 ?

said on 02 Oct 2006 at 11:27

and ?! => 33

said on 02 Oct 2006 at 11:38

Because

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

said on 02 Oct 2006 at 11:38

Same reason ?a => 97. To wit.

said on 02 Oct 2006 at 11:40

? 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 02 Oct 2006 at 11:44
evan: A Convoluted loop to explain ?’s syntax would be

eval("?\\#{??.to_s(8)}").chr
said on 02 Oct 2006 at 12:13

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

said on 02 Oct 2006 at 13:28
!!??  !!!??
true  false

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

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!??
said on 02 Oct 2006 at 14:23

Nick: False!

said on 02 Oct 2006 at 14:41

Nick: False. 41 !s.

said on 02 Oct 2006 at 15:52

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

said on 02 Oct 2006 at 16:18

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

said on 02 Oct 2006 at 16:28

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

http://iorcc.blogspot.com/

said on 03 Oct 2006 at 01:20

that took some time to understand… parentheses help.

said on 09 Oct 2006 at 23:51

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


YaY! I’ll never miss Perl again!

said on 13 Oct 2006 at 15:19

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

11 Jul 2010 at 20:59

* do fancy stuff in your comment.

PREVIEW PANE