Created
January 9, 2024 08:59
-
-
Save matstc/d2bf1a7fe53555ea554382d01ae1ae4e to your computer and use it in GitHub Desktop.
Convert letters to squared equivalents and numbers to circled equivalents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Adds a border around all the arguments passed to this script. | |
# | |
# Example: | |
# | |
# $ borderify hello you | |
# => π·β―π΄β―π»β―π»β―πΎβ― β―π β―πΎβ―π | |
LOOKUP_TABLE = { | |
a: "π°", | |
b: "π±", | |
c: "π²", | |
d: "π³", | |
e: "π΄", | |
f: "π΅", | |
g: "πΆ", | |
h: "π·", | |
i: "πΈ", | |
j: "πΉ", | |
k: "πΊ", | |
l: "π»", | |
m: "πΌ", | |
n: "π½", | |
o: "πΎ", | |
p: "πΏ", | |
q: "π ", | |
r: "π ", | |
s: "π ", | |
t: "π ", | |
u: "π ", | |
v: "π ", | |
w: "π ", | |
x: "π ", | |
y: "π ", | |
z: "π ", | |
"0": "βͺ", | |
"1": "β ", | |
"2": "β‘", | |
"3": "β’", | |
"4": "β£", | |
"5": "β€", | |
"6": "β₯", | |
"7": "β¦", | |
"8": "β§", | |
"9": "β¨", | |
}.freeze | |
print( | |
ARGV.join(" ") | |
.chars | |
.map { LOOKUP_TABLE[_1.downcase.to_sym] || _1 } | |
.join("\u202f") # no break thin space | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment