Skip to main content
2 of 2
Commonmark migration

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" 
G B
  • 23.4k
  • 1
  • 24
  • 55