Skip to content

Instantly share code, notes, and snippets.

@jimdoescode
Last active October 4, 2015 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimdoescode/2661872 to your computer and use it in GitHub Desktop.
Save jimdoescode/2661872 to your computer and use it in GitHub Desktop.
Testing anonymous gist
var a = 31337;
var b = 1073741824;
function digital_root(num) {
var strnum = num.toString();
while (strnum.length() > 1) {
var runnum = 0;
for (int i = 0; i < strnum.length(); i++) {
runnum += parseInt(s.charAt(i));
}
strnum = runnum.toString();
}
alert(strnum);
}
digital_root(a);
digital_root(b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment