puts ['ボ', 'ジョ', 'レ', 'ヌ', 'ボ'].shuffle.map.with_index {|x, i| i > 1 ? x+'ー' : x}.join Register as a new user and use Qiita more conveniently You get articles that match your needsYou can efficiently read back useful informationWhat you can do with signing up