5 ms·
explain :)
by mrwnmonm 12y ago
explain :)
- hundunpao 12y agoJavascript [45, 69, 82, 82, 89, 0, 35, 72, 82, 73, 83, 84, 77, 65, 83, 1].map(function(x){ return String.fromCharCode(x +32)}).join('')
- krat0sprakhar 12y agoCopy-paste in your browser console - // Merry Christmas console.log( [45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1] .map(function(i) { return i + 32; }) .map(function(i) { return String.fromCharCode(i); }) .join("") );
- zuppy 12y agoI'm to lazy to do the math (substract and look for ascii code), but it should be "Merry Christmas". clue: look where "r" is i the string.
- awhitty 12y agoPython equivalent for convenience: map(lambda x: chr (x + 32), [45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1]) Just paste it into a python terminal and run it :)
- heinrich5991 12y agoPython 2/3 compatiblity: "".join(map(lambda x: chr (x + 32), [45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1]))
- adregan 12y agoOr as a list comprehension if that's your thing: "".join([chr(x + 32) for x in [45,69,82,82,89,0,35,72,82,73,83,84,77,65,83,1]])
- jarcane 12y ago; Racket version (apply string (map (λ (x) (integer->char (+ x 32))) '(45 69 82 82 89 0 35 72 82 73 83 84 77 65 83 1)))
- kevinavery 12y agoScala List(45,69,82,82,89,0,35,72,89,73,83,84,77,65,83,1) map (_ + 32 toChar) mkString