Spaces:
Sleeping
Sleeping
File size: 2,105 Bytes
5e4df86 7ee050d 5e4df86 5ef4f14 5e4df86 5ef4f14 7ee050d 5e4df86 7ee050d 5ef4f14 5e4df86 7ee050d 5ef4f14 7ee050d 5ef4f14 5e4df86 7ee050d 5ef4f14 5e4df86 5ef4f14 7ee050d 5e4df86 7ee050d 5ef4f14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | def get_ganji_full(birth_date, birth_time, calendar_type):
cheon = ["๊ฐ", "์", "๋ณ", "์ ", "๋ฌด", "๊ธฐ", "๊ฒฝ", "์ ", "์", "๊ณ"]
ji = ["์", "์ถ", "์ธ", "๋ฌ", "์ง", "์ฌ", "์ค", "๋ฏธ", "์ ", "์ ", "์ ", "ํด"]
elements = {"๊ฐ": "๋ชฉ(๋๋ฌด)", "์": "๋ชฉ(๋๋ฌด)", "๋ณ": "ํ(๋ถ)", "์ ": "ํ(๋ถ)", "๋ฌด": "ํ (ํ)", "๊ธฐ": "ํ (ํ)", "๊ฒฝ": "๊ธ(์ )", "์ ": "๊ธ(์ )", "์": "์(๋ฌผ)", "๊ณ": "์(๋ฌผ)"}
animals = {"์": "์ฅ", "์ถ": "์", "์ธ": "๋ฒ", "๋ฌ": "ํ ๋ผ", "์ง": "์ฉ", "์ฌ": "๋ฑ", "์ค": "๋ง", "๋ฏธ": "์", "์ ": "์์ญ์ด", "์ ": "๋ญ", "์ ": "๊ฐ", "ํด": "๋ผ์ง"}
year = birth_date.year
y_idx = year - 4
y_stem = cheon[y_idx % 10]
y_branch = ji[y_idx % 12]
return {
"text_data": f"{year}๋
{birth_date.month}์ {birth_date.day}์ผ {birth_time.hour}์ ({calendar_type})",
"year_ganji": f"{y_stem}{y_branch}๋
",
"animal": animals[y_branch],
"element": elements[y_stem],
"desc": f"๋น์ ์ {animals[y_branch]}๋ ์ด๋ฉฐ, {elements[y_stem]}์ ๊ธฐ์ด์ ํ๊ณ ๋ฌ์ต๋๋ค."
}
def get_fengshui_advanced(year, gender, door_dir, head_dir):
digits_sum = sum(int(digit) for digit in str(year))
while digits_sum > 9: digits_sum = sum(int(digit) for digit in str(digits_sum))
if gender in ["๋จ์ฑ", "Male"]: gua = 11 - digits_sum
else: gua = digits_sum + 4
while gua > 9: gua -= 9
while gua < 1: gua += 9
if gua == 5: gua = 2 if gender in ["๋จ์ฑ", "Male"] else 8
is_east = gua in [1, 3, 4, 9]
group = "๋์ฌํ (East Group)" if is_east else "์์ฌํ (West Group)"
good_dirs = ["๋ถ", "๋", "๋จ", "๋จ๋"] if is_east else ["๋ถ๋", "๋จ์", "์", "๋ถ์"]
is_good_head = any(d in head_dir for d in good_dirs) or (head_dir in good_dirs)
return {
"gua": gua, "group": group, "good_dirs": ", ".join(good_dirs),
"match": is_good_head,
"advice": f"๊ทํ๋ {group}์
๋๋ค. {head_dir} ๋ฐฉํฅ์ {'์ข์' if is_good_head else '๋์'} ๊ธฐ์ด์
๋๋ค."
} |