Quantcast
Channel: Encrypting Emojis - Code Golf Stack Exchange
Browsing latest articles
Browse All 13 View Live

Answer by matteo_c for Encrypting Emojis

Haskell, score 73.2 * 110 bytes = 8052.0import Data.Listj(Just x)=xf s=map(toEnum.(97+).j.(`elemIndex`(map head$sortOn((0-).length)$group$sort s)))sHaskell, score 90.1 * 72 bytes = 6487.2import...

View Article



Image may be NSFW.
Clik here to view.

Answer by Engineer Toast for Encrypting Emojis

Excel, 89.9 * 67 bytes = 6022.9=LET(c,MID(A2,ROW(1:25)*2-1,2),CONCAT(CHAR(96+MATCH(c,UNIQUE(c),0))))This does not optimize for the lowest character sum because doing so in Excel takes so many bytes...

View Article

Answer by Dominic van Essen for Encrypting Emojis

R, 112.5 * 34 bytes = 3825\(x)letters[utf8ToInt(x)%%430%%11]Attempt This Online!Output is a vector of characters in the range "a" to "j".Developed independently of, but uses similar approach to...

View Article

Answer by Arnauld for Encrypting Emojis

JavaScript (ES6), 112.5 * 24 bytes = 2700Expects and returns a list of code points.a=>a.map(n=>n%430%11+96)Try it online!This version uses a fixed mapping of the smileys to abcdefghij.The...

View Article

Answer by JTBrinkmann for Encrypting Emojis

JavaScript (ES5), score: 112.346 * 62 bytes = 6965.433x=>x.replace(/../g,e=>(e.charCodeAt(1)%576%11+9).toString(36))Attempt This Online! A simple hashing method; optimized for the specific emoji...

View Article


Answer by Kevin Cruijssen for Encrypting Emojis

05AB1E, score: 516.3704 (73.7672 * 7 bytes)ÙΣ¢}RA‡Try it online or verify the average score of 10,000 random runs.Explanation:Ù # Uniquify the emoticon-characters of the (implicit) input-stringΣ # Sort...

View Article

Answer by SamR for Encrypting Emojis

R, 73.2 * 81 bytes = 5929.273.2 * 70 bytes = 5124.4 73.2 * 64 bytes = 4684.8Same method as below for finding most common letters, but two significant improvements suggested in comments by @pajonk:-11...

View Article

Answer by SuperStormer for Encrypting Emojis

Python, 107.3917 * 38 bytes = 4080.8846lambda x:[97+ord(c)%3203%13for c in x]Attempt This Online!Outputs as a list of codepoints. Scoring script taken from bsoelch's answer.Python, 101.9159 * 61 bytes...

View Article


Answer by Mama Fun Roll for Encrypting Emojis

sclin, 89.8656 * 30 bytes = 2695.968dup""uniq $abc","zip >M swap :Try it here! Uses a very simple index-based mapping.For testing purposes:10000=$n."🗓🙏📗💻📇🚢🐉💘😪🎉"=$e.$W ( ; S>c 97- +/ ) map $n tk...

View Article


Answer by Value Ink for Encrypting Emojis

Ruby, 90.0438 * 31 bytes = 2,791.3578->s{s.tr s.chars.uniq*'','a-z'}Attempt This Online!Ruby, 73.1206 * 53 bytes = 3,875.3918->s{s.tr s.chars.uniq.sort_by{-s.count(_1)}*'','a-z'}Attempt This Online!

View Article

Answer by Neil for Encrypting Emojis

Charcoal, score 90.24 * 13 bytes = 1173.12⭆θ§β⌕Φθ⁼μ⌕θλιTry it online! Link is to verbose version of code. Attempt This Online! Link is to test suite for 10000 random iterations. Explanation: Outputs...

View Article

Answer by bsoelch for Encrypting Emojis

Python, score 103.6078*101 bytes = 10464,3878assigns the characters in alphabetical orderlambda l:''.join(chr(97+[x for(x,_)in groupby(sorted(l))].index(c))for c in l)from itertools import*Attempt This...

View Article

Encrypting Emojis

ProblemYou are tasked with creating a program that performs emoji encryption on a given string of emojis. In this encryption scheme, each emoji is replaced by a unique character (from a to z). Your...

View Article

Browsing latest articles
Browse All 13 View Live




Latest Images