Created
December 11, 2011 13:31
-
-
Save pce/1460634 to your computer and use it in GitHub Desktop.
ascii map text-format
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
<script> | |
function asciimap_decode (s) { | |
var out = ''; | |
var _r = []; | |
var count, ascii = 0; | |
var blocks = s.split('|'); | |
// console.log(blocks); | |
for (var block in blocks) { | |
// console.log(blocks[block]); | |
_r = blocks[block].split(':'); | |
count = _r[0]; | |
ascii = _r[1]; | |
for (i = 0;i < count; i++) | |
out += String.fromCharCode(ascii); | |
} | |
return out; | |
}; | |
document.write('<pre>'); | |
document.write(asciimap_decode('2:32|1:79|3:45|1:79|1:10|1:32|1:47|1:32|1:92|1:32|1:47|1:32|1:92|1:10|1:79|3:45|1:79|3:45|1:79|1:10|1:32|1:92|1:32|1:47|1:32|1:92|1:32|1:47|1:10|2:32|1:79|3:45|1:79')); | |
document.write('</pre>'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment