Skip to content

Instantly share code, notes, and snippets.

@KoRMaK
KoRMaK / optimize me.rb
Last active October 14, 2015 18:46
A million monkeys typing on a million typewriters
#A ruby version of http://i.imgur.com/2PHAoxm.png
#This program will sort the word "typewriter" in alphabetical order
start_time = Time.now
s = "typewriter"
max_int = 2**32
for i in 0..max_int-1
s = s.split("").shuffle.join
if s == "eeiprrttwy"
puts s