for fun I am creating in ruby a simple leet (1337) generator
so i am doing something like this, which works but doesn’t look very efficient, i am sure it can be accomplished with one line only…
def leet
words = words.gsub(/a/, '4')
words = words.gsub(/e/, '3')
words = words.gsub(/i/, '1')
words = words.gsub(/o/, '0')
words = words.gsub(/s/, '5')
words = words.gsub(/t/, '7')
puts words
end
Can you give me a help here? 🙂 thanks!
1 Answer