Skip to content

Instantly share code, notes, and snippets.

@BobbySig
Last active December 20, 2015 13:19
Show Gist options
  • Save BobbySig/6138108 to your computer and use it in GitHub Desktop.
Save BobbySig/6138108 to your computer and use it in GitHub Desktop.
Calculate which Major Arcana you belong to based on the formula described in a deviantart post!
<!DOCTYPE html>
<html>
<head>
<title>Arcana Calculator</title>
</head>
<body>
<script type="text/javascript">
//document.write("I Pity The Fool Who Thinks This Actually Works Right Now <br>");
function nameCalc(nameIn2) {
nameIn = nameIn2.toUpperCase();
//document.write(nameIn2 + " " + nameIn + "<br>");
total = 0;
for (var i = nameIn.length - 1; i >= 0; i--) {
switch(nameIn.charAt(i)) {
case 'A':
case 'J':
case 'S':
total++;
break;
case 'B':
case 'K':
case 'T':
total += 2;
break;
case 'C':
case 'L':
case 'U':
total += 3;
break;
case 'D':
case 'M':
case 'V':
total += 4;
break;
case 'E':
case 'N':
case 'W':
total += 5;
break;
case 'F':
case 'O':
case 'X':
total += 6;
break;
case 'G':
case 'P':
case 'Y':
total += 7;
break;
case 'H':
case 'Q':
case 'Z':
total += 8;
break;
case 'I':
case 'R':
total += 9;
break;
}
}
return sumDigits(total);
}
function showArcana(aNum) {
urlStart = "http://www.thelostfound.com/tarot/cards/meanings/";
document.write("That means you belong to the ");
switch(aNum) {
case 0:
case "0":
case 22:
case "22":
document.write("<a href=" + urlStart + "fool.html>Fool</a>");
break;
case 1:
case "1":
document.write("<a href=" + urlStart + "magus.html>Magician</a>");
break;
case 2:
case "2":
document.write("<a href=" + urlStart + "priestess.html>High Priestess</a>");
break;
case 3:
case "3":
document.write("<a href=" + urlStart + "empress.html>Empress</a>");
break;
case 4:
case "4":
document.write("<a href=" + urlStart + "emperor.html>Emperor</a>");
break;
case 5:
case "5":
document.write("<a href=" + urlStart + "hiero.html>Hierophant</a>");
break;
case 6:
case "6":
document.write("<a href=" + urlStart + "lovers.html>Lovers</a>");
break;
case 7:
case "7":
document.write("<a href=" + urlStart + "chariot.html>Chariot</a>");
break;
case 8:
case "8":
document.write("<a href=" + urlStart + "strength.html>Strength</a>");
break;
case 9:
case "9":
document.write("<a href=" + urlStart + "hermit.html>Hermit</a>");
break;
case 10:
case "10":
document.write("<a href=" + urlStart + "fortune.html>Fortune</a>");
break;
case 11:
case "11":
document.write("<a href=" + urlStart + "justice.html>Justice</a>");
break;
case 12:
case "12":
document.write("<a href=" + urlStart + "hanged.html>Hanged Man</a>");
break;
case 13:
case "13":
document.write("<a href=" + urlStart + "death.html>Death</a>");
break;
case 14:
case "14":
document.write("<a href=" + urlStart + "temperan.html>Tempperance</a>");
break;
case 15:
case "15":
document.write("<a href=" + urlStart + "devil.html>Devil</a>");
break;
case 16:
case "16":
document.write("<a href=" + urlStart + "tower.html>Tower</a>");
break;
case 17:
case "17":
document.write("<a href=" + urlStart + "star.html>Star</a>");
break;
case 18:
case "18":
document.write("<a href=" + urlStart + "moon.html>Moon</a>");
break;
case 19:
case "19":
document.write("<a href=" + urlStart + "sun.html>Sun</a>");
break;
case 20:
case "20":
document.write("<a href=" + urlStart + "judge.html>Judgment</a>");
break;
case 21:
case "21":
document.write("<a href=" + urlStart + "world.html>World</a>");
break;
default:
document.write("Not a valid response. Blame the dumbfuck who wrote this thing.");
break;
}
document.write(" Arcana!<br>");
}
function sumDigits(nums) {
bPLong = parseInt(nums);
out = 0;
//document.write(nums + " ");
while (bPLong > 0) {
out += Math.floor(bPLong % 10);
bPLong = Math.floor(bPLong / 10);
}
//document.write(out + "<br>");
return out;
}
firstName = prompt("Enter your first name:", "");
middleName = prompt("Enter your middle name:", "");
lastName = prompt("Enter your last name:", "");
firstTotal = nameCalc(firstName);
middleTotal = nameCalc(middleName);
lastTotal = nameCalc(lastName);
destinyNum = sumDigits(firstTotal + middleTotal + lastTotal);
bMonth = prompt("Enter the number of your birth month:");
bDay = prompt("Enter the day of the month you were born:");
bYear = prompt("Enter the year you were born:");
birthPath = sumDigits(sumDigits(bYear + bMonth + bDay));
arcanaNum = destinyNum + birthPath;
document.write(firstName + " " + middleName + " " + lastName + ",<br>");
document.write("your Destiny Number is " + destinyNum + ",<br>");
document.write("your Birth Path is " + birthPath + ",<br>");
document.write("and your Arcana Number is " + arcanaNum + ".<br>");
showArcana(arcanaNum);
</script>
<p>
Developed by <a href="http://bobbysig.github.com">Bobby Signor</a> on the night of August 1st, 2013.<br>
Based on <a href="http://abalisk.deviantart.com/art/What-s-your-Arcana-Meme-181457001">this</a> deviantart post.
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment