Skip to main content
Commonmark migration
Source Link

##Ruby, 8 chars

Ruby, 8 chars

eval"<1+ 

Inspired by the Python answers

###How it works

How it works

  • eval can be used to execute an arbitrary string.
  • "<1+ is the minimum set of characters required to build any string

A string in ruby can be built using the empty string as a starting point, and appending ascii characters to it, so for example:

eval ""<<111+1<<11+11+11+1<<111<<11+11+11+1 

is actually equivalent to

eval ""<<112<<34<<111<<34 

which evaluates the string

p"o" 

##Ruby, 8 chars

eval"<1+ 

Inspired by the Python answers

###How it works

  • eval can be used to execute an arbitrary string.
  • "<1+ is the minimum set of characters required to build any string

A string in ruby can be built using the empty string as a starting point, and appending ascii characters to it, so for example:

eval ""<<111+1<<11+11+11+1<<111<<11+11+11+1 

is actually equivalent to

eval ""<<112<<34<<111<<34 

which evaluates the string

p"o" 

Ruby, 8 chars

eval"<1+ 

Inspired by the Python answers

How it works

  • eval can be used to execute an arbitrary string.
  • "<1+ is the minimum set of characters required to build any string

A string in ruby can be built using the empty string as a starting point, and appending ascii characters to it, so for example:

eval ""<<111+1<<11+11+11+1<<111<<11+11+11+1 

is actually equivalent to

eval ""<<112<<34<<111<<34 

which evaluates the string

p"o" 
Source Link
G B
  • 23.4k
  • 1
  • 24
  • 55

##Ruby, 8 chars

eval"<1+ 

Inspired by the Python answers

###How it works

  • eval can be used to execute an arbitrary string.
  • "<1+ is the minimum set of characters required to build any string

A string in ruby can be built using the empty string as a starting point, and appending ascii characters to it, so for example:

eval ""<<111+1<<11+11+11+1<<111<<11+11+11+1 

is actually equivalent to

eval ""<<112<<34<<111<<34 

which evaluates the string

p"o"