Skip to main content
added 17 characters in body
Source Link
KChaloux
  • 569
  • 2
  • 7

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.

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 un-ruby 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 a 'print' function and invoking, when, in fact, it's the first expression (invoked with []) that prints 'Hello, World!'. The line at the end calls the builtin print function, which in this case will do nothing, as it was given no arguments. I could've shortened the code up by removing that line entirely, but I hoped it would lead to some confusion.

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 Un-Ruby-like I could make the code. 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. In fact, the first expression creates an anonymous function that returns 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 is meaningless in this example. I wanted it to look like an invocation of my own custom print, but it's really just printing nothing to the screen. I could have removed it entirely, but I was hoping it would be a source of confusion.

added 17 characters in body
Source Link
KChaloux
  • 569
  • 2
  • 7

???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 un-ruby 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 a 'print' function and invoking, when, in fact, it's the first expression (invoked with []) that prints 'Hello, World!'. The line at the end calls the builtin print function, which in this case will do nothing, as it was given no arguments. I could've shortened the code up by removing that line entirely, but I hoped it would lead to some confusion.

???, 41 Bytes

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.

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 un-ruby 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 a 'print' function and invoking, when, in fact, it's the first expression (invoked with []) that prints 'Hello, World!'. The line at the end calls the builtin print function, which in this case will do nothing, as it was given no arguments. I could've shortened the code up by removing that line entirely, but I hoped it would lead to some confusion.

Source Link
KChaloux
  • 569
  • 2
  • 7

???, 41 Bytes

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.