Created
August 3, 2011 21:07
-
-
Save OpenGrid/1123774 to your computer and use it in GitHub Desktop.
Shortest code possible
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 alfabet="abcdefghjpz679"; | |
var convertToLetters = function(n){for(var a=alfabet,c='',l=a.length;c=a[n%l]+c,n=n/l|0,n--;);return c}; | |
var convertToNumber = function(s,i,v){with(alfabet)for(i=v=0;s[i];v=v*length-~indexOf(s[i++]));return~-v}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment