Skip to content

Instantly share code, notes, and snippets.

@CoralineAda
Created July 25, 2026 23:12
Show Gist options
  • Select an option

  • Save CoralineAda/edef77f87015439b25d78862c4e09c30 to your computer and use it in GitHub Desktop.

Select an option

Save CoralineAda/edef77f87015439b25d78862c4e09c30 to your computer and use it in GitHub Desktop.
Emoji Garden
# Decorate your shared documents with an emoji garden, where collaborators can peacefully rest their cursors.
class EmojiGarden
PLANTS = %w{๐ŸŒฑ ๐ŸŒฟ โ˜˜๏ธ ๐Ÿ€ ๐ŸŽ‹ ๐Ÿƒ ๐Ÿ‚ ๐Ÿ ๐ŸŒพ ๐ŸŒต ๐ŸŒด ๐ŸŒณ ๐ŸŒฒ ๐Ÿชด ๐ŸŒธ ๐Ÿ’ฎ ๐Ÿต๏ธ ๐ŸŒบ ๐ŸŒป ๐ŸŒผ ๐ŸŒท ๐Ÿฅ€ ๐Ÿชท ๐Ÿชป ๐ŸŒน ๐Ÿ„ ๐ŸŒฑ ๐ŸŒฟ โ˜˜๏ธ ๐Ÿ€ ๐ŸŽ‹ ๐Ÿƒ ๐Ÿ‚ ๐Ÿ ๐ŸŒพ ๐ŸŒต ๐ŸŒด ๐ŸŒณ ๐ŸŒฒ ๐Ÿชด ๐ŸŒธ ๐Ÿ’ฎ ๐Ÿต๏ธ ๐ŸŒบ ๐ŸŒป ๐ŸŒผ ๐ŸŒท ๐Ÿฅ€ ๐Ÿชท ๐Ÿชป ๐ŸŒน ๐Ÿ„}
INSECTS = %w{๐Ÿœ ๐Ÿ ๐Ÿž ๐Ÿ› ๐Ÿฆ‹ ๐Ÿชฒ ๐Ÿชณ ๐Ÿชฐ ๐ŸฆŸ ๐Ÿ•ท๏ธ ๐Ÿ•ธ๏ธ ๐Ÿฆ‚}
HAPAX = %w{๐Ÿ‘ฝ}
SPACER = " "
DENSITY = 0.2
attr_accessor :rows, :columns, :hapax
def initialize(rows:, columns:)
@rows = rows;
@columns = columns
@hapax = false
end
def print
rows.times do
row = (PLANTS | INSECTS).sample
row << SPACER
columns.times do
seed = rand(100)
if !hapax && seed == 1
character = HAPAX.sample
hapax = true
else
character = (seed > (DENSITY * 100)) ? (PLANTS | INSECTS).sample : " "
end
row << character
row << SPACER
end
puts row
end
end
end
EmojiGarden.new(rows: 5, columns: 10).print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment