Skip to content

Instantly share code, notes, and snippets.

@Dark32
Last active December 11, 2015 17:28
Show Gist options
  • Save Dark32/4634266 to your computer and use it in GitHub Desktop.
Save Dark32/4634266 to your computer and use it in GitHub Desktop.
def fancy(sss)
tmp = sss[0]
l=0
str =''
sss.each_char{|i|
if i == tmp
l+=1
else
str+=l.to_s+tmp
l=1
tmp = i
end
}
str+=l.to_s+tmp
end
f = File.open('str.txt','wb+')
str = '11'
100.times{|i|
str = fancy(str)
#p str
p i
f.write str+"\n"
}
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment