Ruby, 41 Bytes, cracked by vihan
print -> (){
'Hello, World!'
}[]
print
Thought this might be an interesting language to do it in. I'm gonna guess most people haven't seen code quite like this.
Update
I wanted to see how unUn-rubyRuby-like I could make the code look. I figured that the stab
operator (->
) wouldn't be familiar to everybody, especially when separated with unusual whitespace.
I tried to make it look like I was defining and invoking a custom 'print' function and invoking, when, in. In fact, it's the first expression (invoked with []
)creates an anonymous function that printsreturns the string 'Hello, World!', then immediately invokes it with []
. The result is passed to the built-in print
function to put it on the screen.
The line at the end calls the builtinis meaningless in this example. I wanted it to look like an invocation of my own custom print
function, which in this case will dobut it's really just printing nothing, as it was given no arguments to the screen. I could've shortened the code up by removing that linecould have removed it entirely, but I hopedwas hoping it would lead to somebe a source of confusion.