2021-09-28から1日間の記事一覧

rubyで英単語3つを適当に組み合わせた文字列を3つ作る

three_by_three_words.rb # curl -O https://raw.githubusercontent.com/dwyl/english-words/master/words.txt words = IO.readlines('words.txt', chomp: true) # words.delete_if { |word| word.size != 3 } 3.times do p words.sample(3).map(&:capitaliz…