#! /usr/bin/env python # entro.py -- Quick and easy numerological calculations # Copyright (C) 2005 Hyriand # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # GNU General Public License is available online at: # http://www.gnu.org/licenses/gpl.html def makeMap(d): m = {} for k, v in d.items(): for i in v: m[i] = k return m chaldean = makeMap({ 1: "AIJQY", 2: "BKR", 3: "CGLS", 4: "DMT", 5: "EHNX", 6: "UVW", 7: "OZ", 8: "FP" }) pythagorian = makeMap({ 1: "AJS", 2: "BKT", 3: "CLU", 4: "DMV", 5: "ENW", 6: "FOX", 7: "GPY", 8: "HQZ", 9: "IR" }) def reduce(i): while i >= 10 and i != 11 and i != 22: i = sum([int(c) for c in str(i)]) return i def calc(name, m): total = vowels = consons = 0 for c in [c for c in name if m.has_key(c)]: total += m[c] if c in "AEIOUY": vowels += m[c] else: consons += m[c] return map(reduce, [total, vowels, consons]) if __name__ == "__main__": import sys, readline sys.stdout.write("Your name? ") name = sys.stdin.readline().strip().upper() dob = "" while len(dob) != 8: sys.stdout.write("Date of birth (DDMMYYYY)? ") dob = sys.stdin.readline().strip() if not dob: break try: int(dob) except: dob = "" if dob: print r_dob = reduce(int(dob[:2]) + int(dob[2:5]) + int(dob[5:])) print "Birthpath: %2i" % r_dob parts = name.split() if len(parts) > 1: parts = parts + [name] for part in parts: print print " ".join(p.capitalize() for p in part.split()) total_p, vowels_p, consons_p = calc(part, pythagorian) total_c, vowels_c, consons_c = calc(part, chaldean) print "Destiny: %2i / %2i" % (total_p, total_c) if dob: print "Realization: %2i / %2i" % (reduce(total_p + r_dob), reduce(total_c + r_dob)) print "Heart's desire: %2i / %2i" % (vowels_p, vowels_c) print "Personality: %2i / %2i" % (consons_p, consons_c)