python算小六壬代码

不废话,直接上代码

使用规则:
例如农历十月十号9点06分
点开始运行
请输入农历几月;10
请输入农历几号:10
请输入几点:9
回车
就会出现下面这些。

赤口
大安
空亡 
空亡--音信稀时,五行属土,颜色黄色,方位中央;临勾陈。谋事主三、六、九。有不吉、无结果、忧虑之含义。
诀曰:空亡事不祥,阴人多乖张。求财无利益,行人有灾殃。失物寻不见,官事有刑伤。病人逢暗鬼,析解可安康。

第一个是月数的赤口卦
第二个是日数的大安卦
第三个是时辰的空亡卦

print("无事不占,不急不占,不动不占")
a=(#大安
"\n时辰:大安--身不动时,五行属木,颜色青色,方位东方。临青龙,谋事主一、五、七。有静止、心安。吉祥之含义。"
"\n诀曰:大安事事昌,求谋在东方,失物去不远,宅舍保安康。行人身未动,病者主无妨。将军回田野,仔细好推详。"
)
b=(#留连
"\n时辰:留连--人未归时,五行属水,颜色黑色,方位北方,临玄武,凡谋事主二、八、十。有喑味不明,延迟。纠缠、拖延、漫长之含义。"
"\n诀曰:留连事难成,求谋日未明。官事只宜缓,去者来回程,失物南方去,急寻方心明。更需防口舌,人事且平平。"
)
c=(#速喜
"\n时辰:速喜--人即至时,五行属火,颜色红色方位南方,临朱雀,谋事主三,六,九。有快速、喜庆,吉利之含义。指时机已到。"
"\n诀曰:速喜喜来临,求财向南行。失物申未午,逢人要打听。官事有福德,病者无须恐。田宅六畜吉,行人音信明。"
)
d=(#赤口
"\n时辰:赤口--官事凶时,五行属金,颜色白色,方位西方,临白虎,谋事主四、七,十。有不吉、惊恐,凶险、口舌是非之含义。"
"\n诀曰:赤口主口舌,官非切要防。失物急去寻,行人有惊慌。鸡犬多作怪,病者出西方。更须防咀咒,恐怕染瘟殃。"
)
e=(#小吉
"\n时辰:小吉--人来喜时,五行属木,临六合,凡谋事主一、五、七有和合、吉利之含义。"
"\n诀曰:小吉最吉昌,路上好商量。阴人来报喜,失物在坤方。行人立便至,交易甚是强,凡事皆和合,病者祈上苍。"
)
f=(#空亡
"\n时辰:空亡--音信稀时,五行属土,颜色黄色,方位中央;临勾陈。谋事主三、六、九。有不吉、无结果、忧虑之含义。"
"\n诀曰:空亡事不祥,阴人多乖张。求财无利益,行人有灾殃。失物寻不见,官事有刑伤。病人逢暗鬼,析解可安康。"
)

liuren=["大安","留连","速喜","赤口","小吉","空亡"]
sc=["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
shic=[1,2,3,4,5,6,7,8,9,10,11,12]
zi=[23,24]                      #23点~~1点
cho=[1,2]                       #1点~~3点
yin=[3,4]                       #3点~~5点
mao=[5,6]                       #5点~~7点
chen=[7,8]                      #7点~~9点
si=[9,10]                       #9点~~11点
wu=[11,12]                      #11点~~1点
wei=[13,14]                     #13点~~15点
shen=[15,16]                    #15点~~17点
you=[17,18]                     #17点~~19点
xu=[19,20]                      #19点~~21点
hai=[21,22]                     #21点~~23点
daan=[1,7,13,19,25,31]          #大安
liulian=[2,8,14,20,26]          #留连
suxi=[3,9,15,21,27]            #速喜
chiko=[4,10,16,22,28]           #赤口
xiaoji=[5,11,17,23,29]          #小吉
kongwang=[6,12,18,24,30]        #空亡
K=input("是否开始,Y/N:")
Y="Y"
N="N"
if K ==Y:

    y=eval(input("请输入农历几月;"))
    t=eval(input("请输入农历几号:"))
    s=eval(input("请输入几点:"))


    if s in zi :
        s = 1
    elif s in cho:
        s = 2

    elif s in yin:
        s = 3

    elif s in mao:
        s = 4

    elif s in chen:
        s = 5

    elif s in si:
        s = 6

    elif s in wu:
        s = 1

    elif s in wei:
        s = 2

    elif s in shen:
        s = 3

    elif s in you:
        s = 4

    elif s in xu:
        s = 5

    elif s in hai:
        s = 6

    if y in daan:                       #月数大安
        print(liuren[0])
        if t in daan:
            print(liuren[0])
            if s == 1:
                print(liuren[0],a)
            elif s == 2:
                print(liuren[1],b)
            elif s == 3:
                print(liuren[2],c)
            elif s == 4:
                print(liuren[3],d)
            elif s == 5:
                print(liuren[4],e)
            elif s == 6:
                print(liuren[5],f)

        elif t in liulian:
            print(liuren[1])
            if s == 1:
                print(liuren[1],b)
            elif s == 2:
                print(liuren[2],c)
            elif s == 3:
                print(liuren[3],d)
            elif s == 4:
                print(liuren[4],e)
            elif s == 5:
                print(liuren[5],f)
            elif s == 6:
                print(liuren[0],a)

        elif t in suxi:
            print(liuren[2])
            if s == 1:
                print(liuren[2],c)
            elif s == 2:
                print(liuren[3],d)
            elif s == 3:
                print(liuren[4],e)
            elif s == 4:
                print(liuren[5],f)
            elif s == 5:
                print(liuren[0],a)
            elif s == 6:
                print(liuren[1],b)

        elif t in chiko:
            print(liuren[3])
            if s == 1:
                print(liuren[3],d)
            elif s == 2:
                print(liuren[4],e)
            elif s == 3:
                print(liuren[5],f)
            elif s == 4:
                print(liuren[0],a)
            elif s == 5:
                print(liuren[1],b)
            elif s == 6:
                print(liuren[2],c)

        elif t in xiaoji:
            print(liuren[4])
            if s == 1:
                print(liuren[4],e)
            elif s == 2:
                print(liuren[5],f)
            elif s == 3:
                print(liuren[0],a)
            elif s == 4:
                print(liuren[1],b)
            elif s == 5:
                print(liuren[2],c)
            elif s == 6:
                print(liuren[3],d)

        elif t in kongwang:
            print(liuren[5])
            if s == 1:
                print(liuren[5],f)
            elif s == 2:
                print(liuren[0],a)
            elif s == 3:
                print(liuren[1],b)
            elif s == 4:
                print(liuren[2],c)
            elif s == 5:
                print(liuren[3],d)
            elif s == 6:
                print(liuren[4],e)

    elif y in liulian :                 #月数留连
        print(liuren[1])

        if t in daan:
            print(liuren[1])
            if s == 1:
                print(liuren[1],b)
            elif s == 2:
                print(liuren[2],c)
            elif s == 3:
                print(liuren[3],d)
            elif s == 4:
                print(liuren[4],e)
            elif s == 5:
                print(liuren[5],f)
            elif s == 6:
                print(liuren[0],a)

        elif t in liulian:
            print(liuren[2])
            if s == 1:
                print(liuren[2],c)
            elif s == 2:
                print(liuren[3],d)
            elif s == 3:
                print(liuren[4],e)
            elif s == 4:
                print(liuren[5],f)
            elif s == 5:
                print(liuren[0],a)
            elif s == 6:
                print(liuren[1],b)

        elif t in suxi:
            print(liuren[3])
            if s == 1:
                print(liuren[3],d)
            elif s == 2:
                print(liuren[4],e)
            elif s == 3:
                print(liuren[5],f)
            elif s == 4:
                print(liuren[0],a)
            elif s == 5:
                print(liuren[1],b)
            elif s == 6:
                print(liuren[2],c)

        elif t in chiko:
            print(liuren[4])
            if s == 1:
                print(liuren[4],e)
            elif s == 2:
                print(liuren[5],f)
            elif s == 3:
                print(liuren[0],a)
            elif s == 4:
                print(liuren[1],b)
            elif s == 5:
                print(liuren[2],c)
            elif s == 6:
                print(liuren[3],d)

        elif t in xiaoji:
            print(liuren[5])
            if s == 1:
                print(liuren[5],f)
            elif s == 2:
                print(liuren[0],a)
            elif s == 3:
                print(liuren[1],b)
            elif s == 4:
                print(liuren[2],c)
            elif s == 5:
                print(liuren[3],d)
            elif s == 6:
                print(liuren[4],e)

        elif t in kongwang:
            print(liuren[0])
            if s == 1:
                print(liuren[0],a)
            elif s == 2:
                print(liuren[1],b)
            elif s == 3:
                print(liuren[2],c)
            elif s == 4:
                print(liuren[3],d)
            elif s == 5:
                print(liuren[4],e)
            elif s == 6:
                print(liuren[5],f)

    elif y in suxi:                    #月数速喜
        print(liuren[2])

        if t in daan:
            print(liuren[2])
            if s == 1:
                print(liuren[2],c)
            elif s == 2:
                print(liuren[3],d)
            elif s == 3:
                print(liuren[4],e)
            elif s == 4:
                print(liuren[5],f)
            elif s == 5:
                print(liuren[0],a)
            elif s == 6:
                print(liuren[1],b)

        elif t in liulian:
            print(liuren[3])
            if s == 1:
                print(liuren[3],d)
            elif s == 2:
                print(liuren[4],e)
            elif s == 3:
                print(liuren[5],f)
            elif s == 4:
                print(liuren[0],a)
            elif s == 5:
                print(liuren[1],b)
            elif s == 6:
                print(liuren[2],c)

        elif t in suxi:
            print(liuren[4])
            if s == 1:
                print(liuren[4])
            elif s == 2:
                print(liuren[5])
            elif s == 3:
                print(liuren[0])
            elif s == 4:
                print(liuren[1])
            elif s == 5:
                print(liuren[2])
            elif s == 6:
                print(liuren[3])

        elif t in chiko:
            print(liuren[5])
            if s == 1:
                print(liuren[5], f)
            elif s == 2:
                print(liuren[0], a)
            elif s == 3:
                print(liuren[1], b)
            elif s == 4:
                print(liuren[2], c)
            elif s == 5:
                print(liuren[3], d)
            elif s == 6:
                print(liuren[4], e)

        elif t in xiaoji:
            print(liuren[0])
            if s == 1:
                print(liuren[0],a)
            elif s == 2:
                print(liuren[1],b)
            elif s == 3:
                print(liuren[2],c)
            elif s == 4:
                print(liuren[3],d)
            elif s == 5:
                print(liuren[4],e)
            elif s == 6:
                print(liuren[5],f)

        elif t in kongwang:
            print(liuren[1])
            if s == 1:
                print(liuren[1],b)
            elif s == 2:
                print(liuren[2],c)
            elif s == 3:
                print(liuren[3],d)
            elif s == 4:
                print(liuren[4],e)
            elif s == 5:
                print(liuren[5],f)
            elif s == 6:
                print(liuren[0],a)

    elif y in chiko:                    #月数赤口
        print(liuren[3])

        if t in daan:
            print(liuren[3])
            if s == 1:
                print(liuren[3],d)
            elif s == 2:
                print(liuren[4],e)
            elif s == 3:
                print(liuren[5],f)
            elif s == 4:
                print(liuren[0],a)
            elif s == 5:
                print(liuren[1],b)
            elif s == 6:
                print(liuren[2],c)

        elif t in liulian:
            print(liuren[4])
            if s == 1:
                print(liuren[4],e)
            elif s == 2:
                print(liuren[5],f)
            elif s == 3:
                print(liuren[0],a)
            elif s == 4:
                print(liuren[1],b)
            elif s == 5:
                print(liuren[2],c)
            elif s == 6:
                print(liuren[3],d)

        elif t in suxi:
            print(liuren[5])
            if s == 1:
                print(liuren[5], f)
            elif s == 2:
                print(liuren[0], a)
            elif s == 3:
                print(liuren[1], b)
            elif s == 4:
                print(liuren[2], c)
            elif s == 5:
                print(liuren[3], d)
            elif s == 6:
                print(liuren[4], e)

        elif t in chiko:
            print(liuren[0])
            if s == 1:
                print(liuren[0], a)
            elif s == 2:
                print(liuren[1], b)
            elif s == 3:
                print(liuren[2], c)
            elif s == 4:
                print(liuren[3], d)
            elif s == 5:
                print(liuren[4], e)
            elif s == 6:
                print(liuren[5], f)

        elif t in xiaoji:
            print(liuren[1])
            if s == 1:
                print(liuren[1],b)
            elif s == 2:
                print(liuren[2],c)
            elif s == 3:
                print(liuren[3],d)
            elif s == 4:
                print(liuren[4],e)
            elif s == 5:
                print(liuren[5],f)
            elif s == 6:
                print(liuren[0],a)

        elif t in kongwang:
            print(liuren[2])
            if s == 1:
                print(liuren[2], c)
            elif s == 2:
                print(liuren[3], d)
            elif s == 3:
                print(liuren[4], e)
            elif s == 4:
                print(liuren[5], f)
            elif s == 5:
                print(liuren[0], a)
            elif s == 6:
                print(liuren[1], b)

    elif y in xiaoji:                   #月数小吉
        print(liuren[4])

        if t in daan:
            print(liuren[4])
            if s == 1:
                print(liuren[4], e)
            elif s == 2:
                print(liuren[5], f)
            elif s == 3:
                print(liuren[0], a)
            elif s == 4:
                print(liuren[1], b)
            elif s == 5:
                print(liuren[2], c)
            elif s == 6:
                print(liuren[3], d)

        elif t in liulian:
            print(liuren[5])
            if s == 1:
                print(liuren[5],f)
            elif s == 2:
                print(liuren[0],a)
            elif s == 3:
                print(liuren[1],b)
            elif s == 4:
                print(liuren[2],c)
            elif s == 5:
                print(liuren[3],d)
            elif s == 6:
                print(liuren[4],e)

        elif t in suxi:
            print(liuren[0])
            if s == 1:
                print(liuren[0],a)
            elif s == 2:
                print(liuren[1],b)
            elif s == 3:
                print(liuren[2],c)
            elif s == 4:
                print(liuren[3],d)
            elif s == 5:
                print(liuren[4],e)
            elif s == 6:
                print(liuren[5],f)

        elif t in chiko:
            print(liuren[1])
            if s == 1:
                print(liuren[1],b)
            elif s == 2:
                print(liuren[2],c)
            elif s == 3:
                print(liuren[3],d)
            elif s == 4:
                print(liuren[4],e)
            elif s == 5:
                print(liuren[5],f)
            elif s == 6:
                print(liuren[0],a)

        elif t in xiaoji:
            print(liuren[2])
            if s == 1:
                print(liuren[2],c)
            elif s == 2:
                print(liuren[3],d)
            elif s == 3:
                print(liuren[4],e)
            elif s == 4:
                print(liuren[5],f)
            elif s == 5:
                print(liuren[0],a)
            elif s == 6:
                print(liuren[1],b)

        elif t in kongwang:
            print(liuren[3])
            if s == 1:
                print(liuren[3],d)
            elif s == 2:
                print(liuren[4],e)
            elif s == 3:
                print(liuren[5],f)
            elif s == 4:
                print(liuren[0],a)
            elif s == 5:
                print(liuren[1],b)
            elif s == 6:
                print(liuren[2],c)

    elif y in kongwang:                 #月数空忘
        print(liuren[5])

        if t in daan:
            print(liuren[5])
            if s == 1:
                print(liuren[5],f)
            elif s == 2:
                print(liuren[0],a)
            elif s == 3:
                print(liuren[1],b)
            elif s == 4:
                print(liuren[2],c)
            elif s == 5:
                print(liuren[3],d)
            elif s == 6:
                print(liuren[4],e)

        elif t in liulian:
            print(liuren[0])
            if s == 1:
                print(liuren[0],a)
            elif s == 2:
                print(liuren[1],b)
            elif s == 3:
                print(liuren[2],c)
            elif s == 4:
                print(liuren[3],d)
            elif s == 5:
                print(liuren[4],e)
            elif s == 6:
                print(liuren[5],f)

        elif t in suxi:
            print(liuren[1])
            if s == 1:
                print(liuren[1],b)
            elif s == 2:
                print(liuren[2],c)
            elif s == 3:
                print(liuren[3],d)
            elif s == 4:
                print(liuren[4],e)
            elif s == 5:
                print(liuren[5],f)
            elif s == 6:
                print(liuren[0],a)

        elif t in chiko:
            print(liuren[2])
            if s == 1:
                print(liuren[2],c)
            elif s == 2:
                print(liuren[3],d)
            elif s == 3:
                print(liuren[4],e)
            elif s == 4:
                print(liuren[5],f)
            elif s == 5:
                print(liuren[0],a)
            elif s == 6:
                print(liuren[1],b)

        elif t in xiaoji:
            print(liuren[3])
            if s == 1:
                print(liuren[3],d)
            elif s == 2:
                print(liuren[4],e)
            elif s == 3:
                print(liuren[5],f)
            elif s == 4:
                print(liuren[0],a)
            elif s == 5:
                print(liuren[1],b)
            elif s == 6:
                print(liuren[2],c)

        elif t in kongwang:
            print(liuren[4])
            if s == 1:
                print(liuren[4],e)
            elif s == 2:
                print(liuren[5],f)
            elif s == 3:
                print(liuren[0],a)
            elif s == 4:
                print(liuren[1],b)
            elif s == 5:
                print(liuren[2],c)
            elif s == 6:
                print(liuren[3],d)
elif K == N:
    input("\n\n按下Ether退出代码")
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值