Rubyology

ScreenCast 5: Web 2.0 Names


Listen Later

This Rubyology screencast will focus on the Ruby random function and should serve as a refresher on arrays and hashes as well as looping. The source code to our example is provided below: # Rubyology Screencast - Web 2.0 Name Randomizer 10.times do letters = { ?v = 'aeiou', ?c = 'bcdfghjklmnpqrstvwxyz'} word = '' 'cvcvc'.each_byte do |x| source = letters[x] word << source[rand(source.length)].chr end puts word + '.com' end
...more
View all episodesView all episodes
Download on the App Store

RubyologyBy Chris Matthieu