New answers tagged

1

JavaScript (V8) t=>t.replace(/./g,d=>/[a-z]/i.test(d)?((parseInt(d,36)-8)%26+10).toString(36)[/[A-Z]/.test(d)?"toUpperCase":"valueOf"]():d) This is code golf, short is popular.


0

Javascript s=/* <k6cM L zE0 2]B^ cyF #hq% m(xg [ ; u e & & V 1 + T H h = $ T }cJF* H7Yj} *&P8 n^D> N ; 0O+ [G{ < s > w < S 8 ( Q ! 2 9 2 { Ya8u qf]?H Z J 6 5 sRvz **/ x=>x //yE c ...


1

Can't let @Mason have it for free (edit 1: also @Neil posted as I write this), so I'm dropping in with answer number 4 and 5 (edit 2: goddamn someone posted another answer): the python convertors. Answer One: the easy version (string conversion using split()) import math def combine(stringA, stringB): stringC = stringA + "\n" + stringB len1 ...


2

JavaScript const obfuscate = str => [...str].map(e=>e.charCodeAt(0).toString(36) + '?').join``; const combine = (first, second) => obfuscate(first) + ' ' + obfuscate(second); const separate = string => string.split(' ').map(x =>x.split('?').filter(b=>b).map(el => String.fromCharCode(parseInt(el, 36))).join``);


2

Charcoal Works by prefixing each character of the first string with a comma, suffixing each character of the second string with a comma, and then joining the strings with a semicolon. This simplifies decoding as there are an equal number of commas and original characters. There is a slight Charcoal gotcha in that it can't chop a zero-length string, so to ...


3

Charcoal Simply lists the code points in both strings. Within each string, code points are delimited with commas, and the two strings's code points are separated with a semicolon. The only gotcha is to ensure that empty strings decode to empty strings. Combine ⪫E²⪫ES℅λ,¦; Try it online! Link is to verbose version of code. Separate E⪪S;∧ι⭆⪪ι,℅Iλ Try it ...


7

I know this is extra credit, but your problem got me thinking a lot about this and what interested me the most was not just separate being the left inverse of combine, but having them be true inverses of each other. This ends up with us defining a bijection from String -> String x String. The path I took was as follows Define a bijection from String ->...


2

><> x; > Try it online!


0

Pxem, filename: 7 bytes + content: 0 bytes = 7 bytes, depends on implementation. Filename (escaped): \002.r.w.a Content: empty. How it works \002.r: pushes one of 0 or 1. .w ... .a: while empty || pop!=0; do ... ;done Try it online!


0

Pxem (pxemi.2.min.posixism), Filename: 14 bytes + Content: 0 bytes = 14 bytes. Filename (has trailing LF!): .a B4 .[wxyz] Content: empty. Try it online!


0

Pyth Dang those bounce back emails, I've been broke ever since the boss started charging us for every mistype. And he wonders why I wanted to quit in the first place... De$tination_unreachable:"Reason message:\ Couldn't find the address theboss@company.xom\ Company email servers charge for wasted electricity on bounce back emails:\ In this case, the ...


2

Excel =LET( me, say that I understand your decision. I was hoping to work our issues, out, B4#, things, got so out of control. I hope we can as Boss and, Programmer, SORT(out), our, issues and work better together in the future, Sincerely, John Smith, Programmer)


Top 50 recent answers are included