Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate a random emoji bomb via the command-line
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
# Run `emojibomb` to get three emoji.
# Run `emojibomb N`, where `N` is a positive integer to get N emoji.
response = open("")
html =
emoji = html.scan(/:\S+:/)
count = [ARGV.first.to_i, 3].max
bomb = ""
count.times do
bomb << emoji.sample
puts bomb

This comment has been minimized.

Copy link

shiftyp commented Sep 27, 2019

I found this looking for random emojis in ruby. Here's another way to generate random emojis (I'm unsure about the exact range, but the method is simple).



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.