Skip to content

Instantly share code, notes, and snippets.

@yxhuvud
Last active December 16, 2016 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yxhuvud/bfc0bd432da4b66d1570e18b468b0a14 to your computer and use it in GitHub Desktop.
Save yxhuvud/bfc0bd432da4b66d1570e18b468b0a14 to your computer and use it in GitHub Desktop.
data = ['0', '1']
while data.size.even?
data = data.each_slice(2).map do |(a, b)|
a == b ? '1' : '0'
end
end
data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment