Created
September 24, 2013 13:43
-
-
Save spoike/6684909 to your computer and use it in GitHub Desktop.
For determining which character to take from an ascii table using row and column indices.
This file contains hidden or 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
| var toAsciiIndex = function(str) { | |
| var i, carr = [], curr; | |
| for(i = 0; i < str.length; i++) { | |
| curr = str.charCodeAt(i); | |
| carr.push([curr%32, Math.floor(curr/32)]); | |
| } | |
| return carr; | |
| }; | |
| toAsciiIndex("Hah"); // -> [[8,2],[1,3],[8,3]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment