八字易经算法之用JAVA实现简单择日算法

  现在的网络真的很方便,就拿黄历来说;百度一下万年历,很多的!

可是我想,应该有它的算法吧!其实网上也是一大堆,所有我也拿到这里来讨论讨论,呵呵...
期待大家的回帖,希望大侠的到来,其实我只是想脱离万年历,自己笔算出来!也是自娱自乐了!
比如输入一日期,得出该日期的宜与忌,但不知是根据什么思路所作,好像里面用到了阴阳五行。


  一直上网发现有人求万年历上吉凶日/择日算法或者源代码,更有此类软件竟要收费几十元。
  我上网查找半天也没有具体原理的文章。
  作为易学高手的我(大师♂罗莊)对告诉各位码农如何制作吉凶日/择日算法  负有不可推卸的责任。

  今天开的课程就是简单择日算法

  之所以简单就是根据一些万年历老黄历实现简单选择。

   课程基础就是推算今天八字。具体教程:http://blog.csdn.net/luozhuang/article/details/8678846

  建议初学者按顺序学习

package dayselcet;

/*
 * 简单的吉日选择日子实现
 *@author luozhuang 大师♂罗莊
 */
import java.text.ParseException;
import java.util.Calendar;
import luozhuanghehun.BaiziRecord;
import luozhuanghehun.LuozhuangshenshaHehun;

/**
 *
 * @author luozhuang 大师♂罗莊
 */
public class luozhuangjiandanxuanri {

    /**
     * 大月:初一,初七,十一,十七,二十三,三十。 小月:初三,初七,十二,二十六。 忌造酒、合酱。
     *
     * @param intChinesemonth 农历月份天数
     * @param intChineseday 农历日子数字
     */
    public static String nomakewine(int intChinesemonth, int intChineseday) {
        if (intChinesemonth == 30) {
            if (intChineseday == 1) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 7) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 12) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 17) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 23) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 30) {
                return "造酒 合酱 ";
            }
        }
        if (intChinesemonth == 29) {
            if (intChineseday == 3) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 7) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 12) {
                return "造酒 合酱 ";
            }
            if (intChineseday == 26) {
                return "造酒 合酱 ";
            }
        }
        return "";
    }

    /**
     * 初五:十四:二十三,穷嘴老鼠不出庵”,月忌
     *
     * @param paramInt
     */
    public static String yueji(int intChineseday) {
        if (intChineseday == 5) {
            return "月忌,初五、十四、二十三,老君炉里不炼丹。";

        }
        if (intChineseday == 14) {
            return "月忌,初五、十四、二十三,老君炉里不炼丹。";

        }
        if (intChineseday == 23) {
            return "月忌,初五、十四、二十三,老君炉里不炼丹。";

        }
        return "";
    }

    public static String donotdo(int intChinesemonth, int intChineseday) {
        if (intChinesemonth == 1) {
            if (intChineseday == 3) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 9) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 15) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 21) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 27) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 2) {
            if (intChineseday == 2) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 8) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 14) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 20) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 26) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 3) {
            if (intChineseday == 1) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 7) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 13) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 19) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 25) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 4) {
            if (intChineseday == 6) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 12) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 18) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 24) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 30) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 5) {
            if (intChineseday == 5) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 11) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 17) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 23) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 29) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 6) {
            if (intChineseday == 4) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 10) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 16) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 22) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 28) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 7) {
            if (intChineseday == 3) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 9) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 15) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 21) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 27) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 8) {
            if (intChineseday == 2) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 8) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 14) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 20) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 26) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 9) {
            if (intChineseday == 1) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 7) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 13) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 19) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 25) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 10) {
            if (intChineseday == 6) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 12) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 18) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 24) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 30) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 11) {
            if (intChineseday == 5) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 11) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 17) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 23) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 29) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 12) {
            if (intChineseday == 4) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 10) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 16) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 22) {
                return "嫁娶 宴饮 ";

            }
            if (intChineseday == 28) {
                return "嫁娶 宴饮 ";

            }
        }
        if (intChinesemonth == 1) {
            if (intChineseday == 6) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 14) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 22) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 30) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 2) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 10) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 18) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 26) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 2) {
            if (intChineseday == 5) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 13) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 21) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 29) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 1) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 9) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 17) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 25) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 3) {
            if (intChineseday == 4) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 12) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 20) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 30) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 8) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 16) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 24) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 4) {
            if (intChineseday == 3) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 11) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 19) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 27) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 7) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 15) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 23) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 30) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 5) {
            if (intChineseday == 2) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 10) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 18) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 26) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 6) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 14) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 22) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 29) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 6) {
            if (intChineseday == 1) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 17) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 25) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 29) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 5) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 13) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 21) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 28) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 7) {
            if (intChineseday == 8) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 16) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 24) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 4) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 12) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 20) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 27) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 8) {
            if (intChineseday == 7) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 15) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 23) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 30) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 3) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 11) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 19) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 26) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 9) {
            if (intChineseday == 6) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 13) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 22) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 29) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 2) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 10) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 18) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 25) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 10) {
            if (intChineseday == 4) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 12) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 21) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 28) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 1) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 9) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 17) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 24) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 11) {
            if (intChineseday == 4) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 13) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 20) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 27) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 8) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 16) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 23) {
                return "行军 出行 经商 交易 ";
            }
        }
        if (intChinesemonth == 12) {
            if (intChineseday == 3) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 11) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 19) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 7) {
                return "行军 出行 经商 交易 ";
            }
            if (intChineseday == 15) {
                return "行军 出行 经商 交易 ";
            }
        }
        if ((intChinesemonth == 1) && (intChineseday == 2)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 2) && (intChineseday == 3)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 3) && (intChineseday == 4)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 4) && (intChineseday == 5)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 5) && (intChineseday == 2)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 6) && (intChineseday == 3)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 7) && (intChineseday == 4)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 8) && (intChineseday == 5)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 9) && (intChineseday == 2)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 10) && (intChineseday == 3)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 11) && (intChineseday == 4)) {
            return "开仓 ";
        }
        if ((intChinesemonth == 12) && (intChineseday == 5)) {
            return "开仓 ";
        }
        if (intChinesemonth == 1) {
            if (intChineseday == 4) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 9) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 2) {
            if (intChineseday == 13) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 18) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 3) {
            if (intChineseday == 22) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 27) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 4) {
            if (intChineseday == 4) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 9) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 5) {
            if (intChineseday == 13) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 18) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 6) {
            if (intChineseday == 22) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 27) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 7) {
            if (intChineseday == 4) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 9) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 8) {
            if (intChineseday == 13) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 18) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 9) {
            if (intChineseday == 2) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 27) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 10) {
            if (intChineseday == 4) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 9) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 11) {
            if (intChineseday == 13) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 18) {
                return "赴任 入宅 ";
            }
        }
        if (intChinesemonth == 12) {
            if (intChineseday == 22) {
                return "赴任 入宅 ";
            }
            if (intChineseday == 27) {
                return "赴任 入宅 ";
            }
        }
        return "";
    }

    /**
     * 民俗吉凶日篇 上兀下兀日 忌上官、赴任、临政、亲民、入学。 阳乾阴巽起正轮,月上初一并顺寻,巽上坤下为兀日,上官入学并遭迍。
     *
     * @param nianyinyang 年阴阳
     * @param intChinesemonth 农历月份
     * @param intChineseday 农历日期
     */
    public static String donot(String nianyinyang, int intChinesemonth, int intChineseday) {
        if ((nianyinyang).equals("阳")) {
            if ((intChinesemonth == 1) || (intChinesemonth == 7)) {
                if (intChineseday == 4) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 6) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 10) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 12) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 16) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 18) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 22) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 24) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 28) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 30) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 2) || (intChinesemonth == 8)) {
                if (intChineseday == 3) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 5) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 9) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 11) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 15) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 17) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 21) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 23) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 27) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 29) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 3) || (intChinesemonth == 9)) {
                if (intChineseday == 2) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 4) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 8) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 10) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 14) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 16) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 20) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 22) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 27) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 29) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 4) || (intChinesemonth == 10)) {
                if (intChineseday == 1) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 3) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 7) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 9) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 13) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 15) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 19) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 21) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 25) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 27) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 5) || (intChinesemonth == 11)) {
                if (intChineseday == 6) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 2) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 12) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 8) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 18) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 14) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 24) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 20) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 30) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 26) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 6) || (intChinesemonth == 12)) {
                if (intChineseday == 5) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 1) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 11) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 7) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 17) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 13) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 23) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 19) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 29) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 25) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
        }
        if ((nianyinyang).equals("阴")) {
            if ((intChinesemonth == 1) || (intChinesemonth == 7)) {
                if (intChineseday == 1) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 3) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 7) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 13) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 15) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 19) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 21) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 25) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 27) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 2) || (intChinesemonth == 8)) {
                if (intChineseday == 6) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 2) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 12) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 8) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 18) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 14) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 24) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 20) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 30) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 26) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 3) || (intChinesemonth == 9)) {
                if (intChineseday == 5) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 1) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 11) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 7) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 17) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 13) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 23) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 19) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 29) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 25) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 4) || (intChinesemonth == 10)) {
                if (intChineseday == 4) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 6) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 10) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 12) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 16) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 18) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 22) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 24) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 28) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 30) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 5) || (intChinesemonth == 11)) {
                if (intChineseday == 3) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 5) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 9) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 11) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 15) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 17) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 21) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 23) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 27) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 29) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
            if ((intChinesemonth == 6) || (intChinesemonth == 12)) {
                if (intChineseday == 2) {
                    return "上官 赴任 临政 亲民 入学 ";


                }
                if (intChineseday == 8) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 7) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 14) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 16) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 20) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 22) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 26) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
                if (intChineseday == 28) {
                    return "上官 赴任 临政 亲民 入学 ";

                }
            }
        }
        return "";
    }

    /**
     * 忌裁衣、纳财 正月:初七,二十七。 二月:初四,十九。 三月:初一,十六。 四月:初九,二十五。 五月:十五,二十五。 六月:初十,二十。
     * 七月:初八,二十二。 八月:初二,初五,十八,十九。 九月:初三,初四,十六,十七。 十月:初一,十四。 十一月:十二,二十二。
     * 十二月:初九,二十五。
     *
     * @param intChinesemonth 农历月份数字
     * @param intChineseday 农历日子数字
     */
    public static String nocutwealth(int intChinesemonth, int intChineseday) {
        if (intChinesemonth == 1) {
            if (intChineseday == 7) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 27) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 2) {
            if (intChineseday == 4) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 19) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 3) {
            if (intChineseday == 1) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 16) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 4) {
            if (intChineseday == 9) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 25) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 5) {
            if (intChineseday == 15) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 25) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 6) {
            if (intChineseday == 10) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 20) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 7) {
            if (intChineseday == 8) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 22) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 8) {
            if (intChineseday == 2) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 5) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 18) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 19) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 9) {
            if (intChineseday == 3) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 4) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 16) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 17) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 10) {
            if (intChineseday == 1) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 14) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 11) {
            if (intChineseday == 12) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 22) {
                return "裁衣 纳财 ";

            }
        }
        if (intChinesemonth == 12) {
            if (intChineseday == 9) {
                return "裁衣 纳财 ";

            }
            if (intChineseday == 25) {
                return "裁衣 纳财 ";

            }
        }
        return "";
    }

    void test(BaiziRecord cal) {
        int intChinesemonth = cal.lunaryue.getLunarMonth();
        int intChineseday = cal.lunaryue.getLunarDay();
       String yueyin=  luozhuangpaipan.LuozhuangcommonClass.tianganyinyang(cal.getganzhiString()[1]);
        println("今天不宜");
        println(donot(yueyin, intChinesemonth, intChineseday));
        println(donotdo(intChinesemonth, intChineseday));
        println(nocutwealth(intChinesemonth, intChineseday));
        println(nomakewine(intChinesemonth, intChineseday));


    }

    public BaiziRecord getbazi(String man) throws ParseException {

        Calendar mancal;

        LuozhuangshenshaHehun myLuozhuangshenshaHehun = new LuozhuangshenshaHehun();
        mancal = myLuozhuangshenshaHehun.getCalendarfromString(man, "yyyy-MM-dd");
        //原来的private 方法改了下
        return getbazi(mancal);

    }

    public BaiziRecord getbazi(Calendar cal) {
        BaiziRecord returnvalue = new BaiziRecord(cal);
        println("农历的日期【" + returnvalue.lunar.toString() + "】");
        /**
         * 很多地方都是按照23:00-1:00为子时这是不对的。
         * 子时24.00-2.00,丑时2.00-4.00,寅时4.00-6.00,卯时6.00-8.00,
         * 辰时8.00-10.00,巳时10.00-12.00,午时12.00-14.00,未时14.00-16.00
         * 申时16.00-18.00,酉时18.00-20.00,戌时20.00-22.00,亥时22.00-24.00
         *
         */
        int time = cal.get(Calendar.HOUR_OF_DAY) / 2;

        //获取生肖
        println("农历生肖【" + returnvalue.lunar.animalsYear() + "】");

        println(konggou);
        println("八字:");
        println(konggou + returnvalue.getGanziyear() + konggou + returnvalue.getGanzimonth() + konggou + returnvalue.getGanziday() + konggou + returnvalue.getGanzitime() + konggou);
        println("农历日期:");
        println(konggou + returnvalue.lunaryue.getLunarYear() + konggou + returnvalue.lunaryue.getLunarMonth() + konggou + returnvalue.lunaryue.getLunarDay());

        println("农历日期:");
        println(konggou + returnvalue.lunaryue.getLunarDayString());
        return returnvalue;

    }

    public void print(String message) {

        result.append(message);
        System.out.print(message);

    }
    String konggou = "     ";
    String konggou2 = "  ";
    StringBuffer result = new StringBuffer();

    public void println(String message) {
        print(message);
        System.out.println(konggou2);
        result.append("\n");
        result.append("\n");
        System.out.println(konggou2);
    }

    public static void main(String[] args) throws ParseException {

        luozhuangjiandanxuanri my = new luozhuangjiandanxuanri();
       my.test(my.getbazi("2013-8-13"));

    }
}

结果:

农历的日期【二零一三年七月初七】  
  
农历生肖【蛇】  
  
       
  
八字:  
  
     癸巳     庚申     辛亥     戊子       
  
农历日期:  
  
     2013     7     7  
  
农历日期:  
  
     初七  
  
今天不宜  
  
上官 赴任 临政 亲民 入学   
  

### 回答1: 周易是中国古代的经典之一,其中包含了很多卜筮算命的内容,对于许多人来说是一种很有趣的文化现象。而随着科技的不断发展,现在我们也可以利用计算机算法来进行周易算命。其中,Java是一种非常流行的编程语言,也被很多人用来开发算法Java算法大全是指Java编程语言中所包含的各种算法的集合。通过这些算法,人们可以对各种数据进行处理和分析,帮助解决各种问题。其中就包括了周易算命算法,可以通过输入生辰八字等信息,计算出不同方面的预测结果。 一般来说,周易算命算法包含三个大的方面,即易学、卜卦和神数。其中易学是指对易经文本进行解读,从中获取各种卜筮结果的方法;卜卦则是通过六十四卦和八卦来进行卜筮;神数则是根据日期和时间等信息来计算出各种预测结果。Java算法大全中包含的周易算命算法一般都是基于这三个方面开发的。 Java算法大全提供了很多不同的周易算命实现方式,开发者可以根据自己的需要选择不同的算法。一些算法可能会涉及到比较复杂的数学计算,需要开发者对算法背后的数学原理进行深入的了解。同时,为了提高算法的效率和准确性,开发者也可以选择使用一些第三方库和工具,如Apache Math和JCL等。 总之,Java算法大全中包含了很多不同的周易算命算法,可以帮助人们快速地进行卜筮预测。同时,开发者也可以通过学习这些算法,了解到周易算命的文化内涵和数学原理。 ### 回答2: 周易是中国古代的一本著名的占卜算命书籍,也是中国古代哲学的重要组成部分。周易通过阐述八卦和六十四卦来揭示万物的变化和人生的命运。而Java是一种流行的编程语言,具有强大的计算和处理数据的能力。 Java算法大全是指Java语言下,各种常用算法实现集合。在周易算命中,我们可以利用Java算法实现卦的卜算和推演。给定初始卦象和占卜所需的参数,可以通过不同的算法来完成这一过程。 例如,可以使用递归函数来根据卦象的阴阳变化关系,计算出卜筮的结果。通过在Java中编写相应的代码,可以从用户输入的初始卦象开始,逐步生成六十四卦的变化序列。在每一步中,根据用户指定的查询值,可以判断当前卜筮的结果,从而推算出未来的命运。 此外,还可以借助Java中的排序算法,对生成的六十四卦序列进行排序,以便更方便地查找特定卦象和相关信息。 总之,借助Java算法大全的各种功能,我们可以更详细、准确地实现周易算命过程中的各种计算和推演。这样的实现不仅提高了算命的效率,也让周易算命更加科学、有效。
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值