Location>code7788 >text

The implementation process of the Zi Wei Dou Shu algorithm

Popularity:539 ℃/2024-10-28 14:05:39

besides the subject matter

I thought about it and thought about it again and again. Anyone who can cultivate into a great master is a "devil". Only a devil would dare to be greedy, angry and foolish. You and I are stuck in the word "dare". Program apes take up the sharp knife, deconstruct everything in the world! Recently, I watched the Journey to the West and had a feeling about it.

"Connections are universal, laws are objective", so can a program be used to deconstruct the objective existence of fate? Let's try it then!

 Zi Wei Dou Shu, a form of Chinese fortune-telling

Zi Wei Dou Shu, a form of Chinese fortune-tellingThe simple fact is that you can tell fortunes. Sounds so mysterious, then we step by step, beat the monsters through.

Rules for Platooning

scheduling twelve houses (in astrology)

Isn't it just lining up twelve palace grids? Prepare twelve grids first, So easy! There are twelve earthly branches and twelve palace positions. In order to quickly pass, here only explain the core principles.

 

Corresponding to the code, prepare the twelve grids to be used in advance, just in case.

        /// <summary>
        /// the twelfth house (e.g. of the moon)
        /// </summary>
        public readonly static string[] CONST_SHIERGONG = { "natal chart (astrology)", "I, me (humble term used by men in public speech)", "couples", "sons and daughters", "wealth", "critical illness", "migration", "make friends", "official position and salary", "farmhouse", "Ford (name)", "father and mother" };


        /// <summary>
        /// celestial trunk
        /// </summary>
        public readonly static string[] CONST_TIANGAN = { "bladed leather or metal armor (old)", "radical in Chinese characters (Kangxi radical 5)", "third in order", "cubes (of food)", "fifth in order", "hexa", "hepta", "laborious", "ninth in order", "tenth in order" };

        /// <summary>
        /// Tokharians (historic people of central Asia)
        /// </summary>
        public readonly static string[] CONST_DIZHI = { "small thing", "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger", "mortise (slot cut inwood to receive a tenon)", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "6th earthly branch: 9-11 am", "7th earthly branch: 11 am-1 pm", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "explain", "10th earthly branch: 5-7 pm", "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)", "12th earthly branch: 12 p.m., 12 nautical miles" };


        /// <summary>
        /// Tokharians (historic people of central Asia)关系对应序号
        /// </summary>
        public readonly static Dictionary<string, int> DiZhi_No_MAP = new Dictionary<string, int>
        {
            { "small thing",1},
            { "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)",2},
            { "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger",3},
            { "mortise (slot cut inwood to receive a tenon)",4},
            { "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon",5},
            { "6th earthly branch: 9-11 am",6},
            { "7th earthly branch: 11 am-1 pm",7},
            { "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)",8},
            { "explain",9},
            { "10th earthly branch: 5-7 pm",10},
            { "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)",11},
            { "12th earthly branch: 12 p.m., 12 nautical miles",12}
        };

 

Angstrom's Palace and Body Palace (c. 4th century AD)

Read the rules:

In the blank chart, from the Yin Palace of the first month, clockwise to the birth month of the Palace of the end, and then from the Palace of the son of the time, counterclockwise to the birth of the branch of the end of the life of the Palace; from the Yin Palace of the first month, clockwise to the birth month of the Palace of the end of the time, and then from the Palace of the son of the time, clockwise to the birth of the branch of the end of the Palace of the Anshi.

It's just counting grids, So Easy!

        /// <summary>
        /// Access to Natal and Body Houses (as if:first month of the lunar year,7-9 am)
        /// </summary>
        /// <returns></returns>
        public static string[] GetMingGongAndShenGong(int monthNum, int hourNum)
        {
            var shenggongIdx = monthNum + hourNum;
            var shenGongDiZhi = CommonVarRule.CONST_DIZHI[shenggongIdx % 12];

            var idx = 14 + (monthNum - hourNum);
            var ming = CommonVarRule.CONST_DIZHI[idx % 12];

            return new string[] { ming, shenGongDiZhi };
        }

the twelve houses of the natal chart

In the above, we have found the grid in which the House of Life and the House of Body are situated, then the twelve houses can be arranged smoothly according to the rules.

It's too simple to be redundant, read the rules carefully.

Starting with the natal house, fill in the following twelve house names in order counterclockwise into the twelve houses of the blank natal chart:

(1) Natal Palace (2) Brothers (3) Husband and Wife (4) Children (5) Wealth and Possessions (6) Diseases (7) Migration (8) Slaves (Dating) (9) Officials and Ranks (10) Fields and Mansions (11) Fuk Tak (12) Parents

 

For example, if the natal house is in Zi, then the house of brother is in Hai, the house of husband and wife is in Xio, the house of children is in You, the house of wealth is in Shen, the house of sickness and disease is in Wei, the house of migration is in Wu, the house of slave is in Si, the house of career is in Chen, the house of field and home is in Mao, the house of virtue is in Yin, and the house of parents is in Ug.

 

On the twelfth house, the heavenly stems (TCM)

The house stems are the ten, A, B, C, D, E, H, G, S, N, D. Look at the rules:

Push the monthly stem of the "five tiger recluse dry" method to launch the c palace of the celestial stem, and then from the c palace according to the celestial stem of the inherent order (i.e., a, b, c ...... deca, the cycle of the row around the row) clockwise into the twelve palaces.

Year of the Five Tigers (e.g. 1997), year of the Return of the Dragon (e.g. 1997)

In the year of A and H, C is the head, and in the year of B and G, E is the head.

The first year of the C-Sin year is the beginning of the search for the Geng, and the D-Non-Non position flows smoothly.

If it is said that where does the e-kei come from, it is good to pursue it above the a-yin.

How to achieve this with code:

        /// <summary>
        /// Getting the c-shou
        /// </summary>
        /// <param name="tianGan"></param>
        /// <returns></returns>
        public static String GetYanShouByTianGan(string tianGan)
        {
            var yDict = new Dictionary<string, string> {
                    { "third in order","thirty-first year A6 of the 60 year cycle, e.g. 1996 or 2056"},
                    { "fifth in order","thirty second year B7 of the 60 year cycle, e.g. 1960 or 2020"},
                    { "hepta","third in order辛"},
                    { "ninth in order","丁ninth in order"},
                    { "bladed leather or metal armor (old)","fifth in order癸"}
                 };
            var yearTianGan = (0, 1);
            return (t => (yearTianGan)).First().Key;
        }

Isn't that simple.

fix the five elements of the natal chart (astrology)

This step is very important, the five elements of the bureau is the foundation of the later row of purple micro star oh.

As usual, read the rules first:

Nayin Five Elements shorthand method:

Heavenly Stem Matching Numbers: A B 1, C D 2, G S 3, E H 4, N D 5.

The number of earth domination: Zi U U Wu Wei 1, Yin U Shen You 2, Chen S Si Xu Hai 3. The number of dry branches will be added together, and the number of checks (if greater than 5, then subtract 5, to check the remainder) to get the Nayin five elements are: 1 wood, 2 gold, 3 water, 4 fire, 5 earth.

 

The Nayin Five Elements are deduced from the Heavenly Stems and Earthly Branches of the Natal Palace. What the Nayin Five Elements are, the Nayin Five Elements Bureau is; if the corresponding numbers of the Nayin Five Elements are a few, the Five Elements Bureau is a few. For example, if the Nayin five elements of the natal stem and branch of the natal palace are wood, then the Nayin five elements bureau is wood, and wood is 1, so it is a bureau of wood.

 

P.S.: Sixty A's with Five Elements of Nayin

A Zi, B Chou, Gold in the Sea, C Yin, Ding Mao, Fire in the Furnace, E Chen, F Si, Wood in the Forest, Geng, Wu, Xin, Wei, Earth on the Roadside, Nonshen, Dec You, Gold in the Sword.

A Xu B Hai Shan Tou Fire, C Zi Ding Chou Jian Xi Shui, W Yin He Mao Cheng Tou Tu, Geng Chen Xin Si Bai La Jin, Non Wu Dec Wei Yang Liu Mu.

Water in the spring of A Shen and B You, earth on the roof of C Xu and D Hai, thunderbolt fire in E Zi and He Chou, pine and cypress wood in Geng Yin and Xin Mao, and ever-flowing water in Nong Chen and Gui Si.

A wu bwei sha zhong jin, c shen ding you shanxia huo, wuxu jihai pingdi mu, geng zi xin chou wall on the earth, non yin dec dao jin foil jin.

A-chen and B-si Overlapping Lamp Flame, C-wu and D-wei Heavenly River Water, W-shen and He-you Dayi Earth, Geng-xu and Xin-hai Hairpin and Chuan-chuan Gold, Non-zi and Dec-chou Sang-zhe Wood.

A Yin, B Mao, Da Xi Shui, C Chen, D Si, Sha Zhong Tu, W Wu, He Wei, Heavenly Fire, Geng Shen, Xin You, Garnet Wood, Nong Xu, Dec Hai, Great Sea Water.

Note that what is described above are rules, not really what you will end up using.

No bullshit on the code:

        /// <summary>
        /// Getting the Five Elements Bureau
        /// </summary>
        /// <param name="mingGan"> </param>
        /// <param name="mingZhi"></param>
        /// <returns></returns> /// <param name="mingZhi"></param>
        public static string GetWuXingJu(string mingGan, string mingZhi)
        {

            Dictionary<string, string> dict = new Dictionary<string, string>();;

            ("A B Zi U Nu Wei", "Jin 4 Bureaus");
            ("A,B,C,D,S,Y", "Shanghai Water Works Agency (SWWA)");; ("A,B,C,D,S,Y", "Shanghai Water Works Agency (SWWA)")
            ("A B C S X X H H", "Fiery Six").

            ("C-D Zi-Ug-Wu-Wei", "Water 2").
            ("C, D, C, D, S, Y", "Fiery Six").
            ("C-Din C-Si-Xu-Hai", "Earth 5").

            ("Wuji zi ug wu wei", "Fire 6").
            ("Wuji yin, dao, shenyou", "Earth 5"); ("Wuji yin, dao, shenyou", "Earth 5"); ("Wuji yin, dao, shenyou", "Earth 5").
            ("wu ji chen si xu hei", "wood three games").

            ("geng xin zi ug wu wei", "earth five innings").
            ("gengxin yinmao shenyou", "wood three games").
            ("Geng Xin Chen Si Xu Hai", "Gold 4").

            ("non deca zi ug wu wei", "wood three games").
            ("non deca yin dao shen you", "gold four games").
            ("non deca chen si hu hei", "water 2").

            return (t => (mingGan) & & (mingZhi)).FirstOrDefault().Value;
        }

fixed purple star (auspicious portent in astrology)

This step is very critical, Zi Wei Xing must be, behind the star, naturally lined up.

Let's start with this rule.

Mnemonic: The month of the birthday is the quotient of the bureau, and the month is the month of the Ziwei. Only add and do not subtract to the whole, yang retreats and yin advances in the heart.

 

Note: Divide the number of days of birth by the five elements of the natal house to get the quotient, and the quotient is inherently ordered by the moon branch to correspond to the geomantic branch of the house.

i.e., c 1, d 2, c 3, f 4, n 5, w 6, s 7, y 8, s 9, h 10, z 11, u 12.

The quotient of the landed branch of the palace is the location of Zi Wei; if you can not divide, you need to add a minimum number, to just can be divided until the number added if the number of singles from the quotient of the landed branch of the palace backward a few, the number added if the number of evens that is, from the quotient of the landed branch of the palace forward a few, set the location of Zi Wei star.

 

For example: water two bureaus born on the 28th, 28 divided by 2, divided by 14, 14 is greater than 12 minus 12 to 2, 2 for the donggong, so Ziwei star falls in the donggong.

There are two ways to do it here, the first way is to implement it out as above. There is another way, the dictionary way that is used, that takes all sorts of situations into account. So let's go with this dumb, simple and brute force approach. Code

        /// <summary>
        /// Get the house position of the Zi Wei star
        /// </summary> /// </summary>
        /// <param name="nongliDay">Lunar day (the first day of the lunar month)</param>
        /// <param name="wuXingJu">Five Elements Bureau</param>
        /// <returns></returns>
        public static string GetZiWeiXingAtGongWei(string nongliDay, string wuXingJu)
        {
            Dictionary<string, int> wuxingJuMap = new Dictionary<string, int> ();;
            ("Water 2", 0);
            
            
            ("Earth 5", 3).
            ("Fire 6", 4).

            Dictionary<string, int> dayMap = new Dictionary<string, int>();
            ("First Year", 0);
            
            ("Junior", 2); ("Junior", 1); ("Junior", 2).
            ("First 4", 3).
            ("Fifth", 4).
            ("6th", 5).
            ("7th", 6).
            ("8th", 7).
            ("9th", 8).
            ("10th", 9).

            ("One", 0);
            ("two", 1); ("three", 1).
            ("Three", 2).
            ("Four", 3).
            ("five", 4).
            ("six", 5).
            ("Seven", 6).
            ("Eight", 7).
            ("Nine", 8).
            ("Ten", 9).

            ("XI", 10).
            ("XII", 11).
            ("xiii", 12).
            ("xiv", 13).
            ("xv", 14).
            ("xvi", 15).
            ("XVII", 16).
            ("xviii", 17).
            ("xix", 18).

            ("xx", 19).
            ("xxi", 20).
            ("xxii", 21).
            ("XXIII", 22).
            ("xxiv", 23).
            ("xxv", 24).
            ("xxvi", 25).
            ("XXVII", 26).
            ("xxviii", 27).
            ("xxix", 28).

            ("xx", 19).
            ("xxi", 20).
            ("XXII", 21).
            ("xxiii", 21); ("xxiii", 22).
            ("xxiv", 23).
            ("xxv", 24).
            ("xxvi", 25).
            ("xxvii", 26).
            ("xxviii", 27); ("xxvi", 25); ("xxviii", 26); ("xxviii", 27).
            ("xxix", 28).

            ("30", 29).
            ("xxx", 29).


            string[,] mTalbe = {
                        {"ug", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "12th earthly branch: 12 p.m., 12 nautical miles", "7th earthly branch: 11 am-1 pm", "10th earthly branch: 5-7 pm"}, {"c", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "12th earthly branch: 12 p.m., 12 nautical miles", "7th earthly branch: 11 am-1 pm", "10th earthly branch: 5-7 pm"}, }
                        {"c", "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "12th earthly branch: 12 p.m., 12 nautical miles", "7th earthly branch: 11 am-1 pm"},
                        {"c", "d", "u", "h", "h" }, {"c", "u", "h", "h" }, {"c", "u", "h", "h" }, {"c", "u", "h", "h" }
                        
                        {"d", "yin", "zi", "yin", "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)"}, {"mortise (slot cut inwood to receive a tenon)", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger", "small thing", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger", "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)"}.
                        {"5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "mortise (slot cut inwood to receive a tenon)", "6th earthly branch: 9-11 am", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger"}, {"5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "mortise (slot cut inwood to receive a tenon)", "6th earthly branch: 9-11 am", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger"}.
                        {"5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "7th earthly branch: 11 am-1 pm", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger", "small thing", "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)"}, {"5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "7th earthly branch: 11 am-1 pm", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger", "small thing", "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)"}
                        {"6th earthly branch: 9-11 am", "mortise (slot cut inwood to receive a tenon)", "mortise (slot cut inwood to receive a tenon)", "6th earthly branch: 9-11 am", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)"}, {"6th earthly branch: 9-11 am", "mortise (slot cut inwood to receive a tenon)", "6th earthly branch: 9-11 am", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)"}
                        {"S", "U", "U", "C", "Z"}, {"S", "U", "U", "C", "Z"}, {"S", "U", "U", "C", "Z"}, {"S", "U", "C", "Z"}
                        {"7th earthly branch: 11 am-1 pm", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "7th earthly branch: 11 am-1 pm", "mortise (slot cut inwood to receive a tenon)", "6th earthly branch: 9-11 am"}.
                        {"7th earthly branch: 11 am-1 pm", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "mortise (slot cut inwood to receive a tenon)", "explain", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger"}, {"NG", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "mortise (slot cut inwood to receive a tenon)", "explain", "3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger"}
                        {"un", "si", "h", "u", "d"}.
                        
                        {"shen", "6th earthly branch: 9-11 am", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "mortise (slot cut inwood to receive a tenon)", "explain"}.
                        {"shen", "7th earthly branch: 11 am-1 pm", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)"}.
                        {"You", "You", "Zi", "You", "Wu"}.
                        
                        {"hu", "u", "shen", "un", "e"}.
                        {"hu", "hu", "s", "6th earthly branch: 9-11 am", "5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon", "small thing"}.
                        {"Hai", "Wei", "Wu", "Si", "You"}.
                        {"Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ "Ñ}, {"Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ", "Ñ "Ñ
                        {"small thing", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "10th earthly branch: 5-7 pm", "mortise (slot cut inwood to receive a tenon)", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)"}, {"small thing", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "", "NG", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)"}.
                        {"zi", "shen", "nu", "shen", "e"}.
                        {"uchu", "10th earthly branch: 5-7 pm", "8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)", "6th earthly branch: 9-11 am", "6th earthly branch: 9-11 am", "6th earthly branch: 9-11 am"}.
                        
                        {"c", "yu", "hu", "hai", "hu"}, {"c", "yu", "hu"}.
                        {"yin", "hu", "ni", "e", "d"}.
                        {"mortise (slot cut inwood to receive a tenon)", "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)", "explain", "10th earthly branch: 5-7 pm", "explain"}.
                        {"mortise (slot cut inwood to receive a tenon)", "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)", "7th earthly branch: 11 am-1 pm", "7th earthly branch: 11 am-1 pm", "6th earthly branch: 9-11 am"}, {"mortise (slot cut inwood to receive a tenon)", "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)", "7th earthly branch: 11 am-1 pm", "6th earthly branch: 9-11 am"}.
                        {"e", "c", "h", "n", "f" }
            }.

            
            int clnIdx = wuxingJuMap[wuXingJu]; return mTalbe[rowIdx].
            return mTalbe[rowIdx, clnIdx];
        }

If you have read this step, you are not far from the final success. Use a simple diagram to see where we are.

compiler

We have lined up the twelve houses with their heavenly stems and earthly branches, the names of the houses, and the Zi Wei stars. The piers of the equivalent of a bridge are built. The rest only need to add a billion points of detail. Truthfully, at this point you can begin to simply theory of life.

Amphibole (constellation)

The fourteen positive stars are arranged with Zi Wei as the point of reference. Look at the rules:

An astrological knack of the Ziwei system:

The Zi Wei Tian Ji is in the opposite direction, separated by a Yang Wu Tian Tong Dang, and also separated by two Lian Zhen Di, the empty three see the Zi Wei Lang.

 

Stars of the Prefecture of Heaven.

Tianfu Taiyin and Greedy Wolf, Jumen Tianxiang and Tianliang, seven killings and three destructive positions, the eight stars are carefully scrutinized.

How the code is implemented:

        /// <summary>
        /// Get the fourteen main star rows
        /// </summary>
        /// <returns></returns>
        public static Dictionary<string, List<string>> Get_ShiSiZhuXingLayout(string ziWeiAtDiZhi)
        {
            Dictionary<string, List<string>> diZhiGongWei = new Dictionary<string, List<string>>();
            foreach (var item in CommonVarRule.CONST_DIZHI)
            {
                (item, new List<string>());
            }

            Dictionary<string, string> tianFuPostion = new Dictionary<string, string>() {
                {"small thing","5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon"}, { "2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)","mortise (slot cut inwood to receive a tenon)"},{"3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger","3rd earthly branch: 3-5 a.m., 1st solar month (4th February-5th March), year of the Tiger" }, { "mortise (slot cut inwood to receive a tenon)","2nd earthly branch: 1-3 a.m., 12th solar month (6th January 3rd February)"},{"5th earthly branch: 7-9 a.m., 3rd solar month (5th April-4th May), year of the Dragon","small thing" },
                { "6th earthly branch: 9-11 am","12th earthly branch: 12 p.m., 12 nautical miles"},{"7th earthly branch: 11 am-1 pm","11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)" }, {"8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)","10th earthly branch: 5-7 pm" }, { "explain","explain"}, {"10th earthly branch: 5-7 pm","8th earthly branch: 1-3 p.m., 6th solar month (7th July-6th August)"},
                { "11th earthly branch: 7-9 p.m., 9th solar month (8th October-6th November)","7th earthly branch: 11 am-1 pm"},{ "12th earthly branch: 12 p.m., 12 nautical miles","6th earthly branch: 9-11 am"}
            };

            int ziWeiDiZhiIdx = CommonVarRule.DiZhi_No_MAP[ziWeiAtDiZhi] - 1;
            int tianFuDiZhiIdx = CommonVarRule.DiZhi_No_MAP[tianFuPostion[ziWeiAtDiZhi]] - 1;

            string[] ziWeiSeriesLayout = { "purple cloud (auspicious portent in astrology)", "", "", "", "Lianzhen or Xiangzhen (c. 1380-1229), Northern Song dynasty poet", "", "", "Datong or Tiantong (city in Jiangsu province)", "Wuquan suburban district of Shanghai", "solar", "", "inscrutable twist of fate" };
            string[] tianFuSeriesLayout = { "Heavenly province (epithet of Sichuan, esp. area around Chengdu)", "the Moon (esp. in Daoism)", "Lupus (star sign)", "great gate", "astrological", "Tianliang suburban district of Chongqing municipality, formerly in Sichuan", "cf Buddhist services for the auspicious reincarnation of the departed", "", "", "", "a defeat", "" };

            //purple cloud (auspicious portent in astrology)星系
            foreach (var item in ziWeiSeriesLayout)
            {
                if (!(item))
                {
                    if (ziWeiDiZhiIdx < 11)
                    {
                        diZhiGongWei[CommonVarRule.CONST_DIZHI[ziWeiDiZhiIdx]].Add(item);
                    }
                    else
                    {
                        diZhiGongWei[CommonVarRule.CONST_DIZHI[ziWeiDiZhiIdx % 12]].Add(item);
                    }
                }
                ziWeiDiZhiIdx++;
            }

            //Heavenly province (epithet of Sichuan, esp. area around Chengdu)星系
            foreach (var item in tianFuSeriesLayout)
            {
                if (!(item))
                {
                    if (tianFuDiZhiIdx < 11)
                    {
                        diZhiGongWei[CommonVarRule.CONST_DIZHI[tianFuDiZhiIdx]].Add(item);
                    }
                    else
                    {
                        diZhiGongWei[CommonVarRule.CONST_DIZHI[tianFuDiZhiIdx % 12]].Add(item);
                    }
                }
                tianFuDiZhiIdx++;
            }

            return diZhiGongWei;
        }

 

Andromeda (star)

        /// <summary>
        /// Andromeda (star)
        /// </summary>
        /// <param name="mingGongDizhi">natal chart of the heavenly body and earthly branches</param>
        /// <returns></returns>
        public static string GetMingZhuXing(string mingGongDizhi)
        {
            Dictionary<string, string> dDoct = new Dictionary<string, string>();
            ("small thing", "Lupus (star sign)");
            ("Year 2, year of the Boar (e.g. 2002)", "great gate");
            ("11th earthly branch: 11th solar month (8th October-6th November), year of the Tiger", "official pay");
            ("forty fourth year U10 of the 60 year cycle, e.g. 1987 or 2047", "literary recreation");
            ("Year 6, year of the Snake (e.g. 2001)", "Wuquan suburban district of Shanghai");
            ("Year 5, year of the Dragon (e.g. 2000)", "Lianzhen or Xiangzhen (c. 1380-1229), Northern Song dynasty poet");
            ("7th earthly branch: 11 am-1 pm", "a defeat");
            var fDict = (t => (mingGongDizhi)).First();
            return ;
        }

solidarity with the main planet

        /// <summary>
        /// solidarity with the main planet
        /// </summary>
        /// <param name="yearDiZhi">Tokharians (historic people of central Asia)</param>
        /// <returns></returns>
        public static string GetShenZhuXing(string yearDiZhi)
        {
            Dictionary<string, string> dDoct = new Dictionary<string, string>();
            ("small thing", "Suzaku Star");
            ("7th earthly branch: 11 am-1 pm", "Mars (planet)");
            ("Year 2, year of the Dragon (e.g. 2002)", "astrological");
            ("3rd earthly branch: 3-5th solar month (4th February-5th March), year of the Tiger", "Tianliang suburban district of Chongqing municipality, formerly in Sichuan");
            ("forty fourth year U10 of the 60 year cycle, e.g. 1987 or 2047", "Datong or Tiantong (city in Jiangsu province)");
            ("Year 6, year 9, year 12 of the Snake (e.g. 2001)", "inscrutable twist of fate");
            ("Year 7, year of the Dog", "Wenchang City, Hainan");

            var fDict = (t => (yearDiZhi)).First();
            return ;
        }

prime minister

Rules:

An Zuo Fu star: Zuo Fu is located in the palace where the first month of the year starts from the palace of Chen, and counts down to the palace of the first month of the year.

The star of An Roubi: Roubi starts in the first month from the house of Gushu, and counts backwards to the house of the birth month, where it is located.

        /// <summary>
        /// Get the Left Auxiliary and Right Auxiliary Stars
        /// </summary>
        /// <param name="monthNo">months 1,2,3,4</param>
        /// <returns></returns>
        public static List<string> Get_FuBi_XingAtDiZhi(int monthNo)
        {
            string zuoFuXIngDiZhi = "";
            if (monthNo + 3 > 11)
            {
                zuoFuXIngDiZhi = CommonVarRule.CONST_DIZHI[(monthNo + 3) % 12];
            }
            else
            {
                zuoFuXIngDiZhi = CommonVarRule.CONST_DIZHI[monthNo + 3];
            }

            string youbiFuXingDiZhi = "";
            if (11 - monthNo >= 0)
            {
                youbiFuXingDiZhi = CommonVarRule.CONST_DIZHI[11 - monthNo];
            }
            else
            {
                youbiFuXingDiZhi = CommonVarRule.CONST_DIZHI[11]; //12th earthly branch: 12 p.m., 12 nautical miles
            }

            return new List<string> { zuoFuXIngDiZhi, youbiFuXingDiZhi };
        }

Wenchang Wenqu

Rules:

An Wenchang star: Wenchang is located in the house where it is counted against the clock from the garrison house to the house of the birth time.

An Wenqu star: Wenqu is located in the palace from the chen palace from the time of the child, counting down to the birth of the palace stops, the palace is.

        /// <summary>
        /// Get Wenqu Wenchang Star Arrangement
        /// </summary>
        /// <param name="hourNo">Earth Branch Time Number</param>
        /// <returns></returns>
        public static List<string> Get_WenChangWenQu_AtDiZhi(string hourDiZhi)
        {

            int hourNo = CommonVarRule.DiZhi_No_MAP[hourDiZhi];

            string wenQuDiZhi = "";
            if (hourNo + 3 > 11)
            {
                wenQuDiZhi = CommonVarRule.CONST_DIZHI[(hourNo + 3) % 12];
            }
            else
            {
                wenQuDiZhi = CommonVarRule.CONST_DIZHI[hourNo + 3];
            }

            string wenChangDiZhi = "";
            if (11 - hourNo >= 0)
            {
                wenChangDiZhi = CommonVarRule.CONST_DIZHI[11 - hourNo];
            }
            else
            {
                //12-->11
                wenChangDiZhi = CommonVarRule.CONST_DIZHI[11];
            }

            return new List<string> { wenQuDiZhi, wenChangDiZhi };
        }

 

ten cadres and four transformations (TCM)

The Ten Stems and the Four Harmonies, the Four Harmonies are the core existence of Zi Wei Dou Shu. The four transformations of Zi Wei Dou Shu are where the gods are used. Very important. If you use a program to represent the rules, it's very simple.

Tetrahedron: Luk Kuen Ke Jie.

        /// <summary>
        /// ten cadres and four transformations (TCM)(locomotive authority and jealousy (idiom); rank, fame and fortune)
        /// </summary>
        /// <param name="tianGan">celestial trunk</param>
        /// <returns></returns>
        public static List<string> Get_ShiGanSiHuaXing(string tianGan)
        {
            Dictionary<string, List<string>> rDict = new Dictionary<string, List<string>>();
            ("bladed leather or metal armor (old)", new List<string> { "Lianzhen or Xiangzhen (c. 1380-1229), Northern Song dynasty poet", "a defeat", "Wuquan suburban district of Shanghai", "solar" });
            ("radical in Chinese characters (Kangxi radical 5)", new List<string> { "inscrutable twist of fate", "Tianliang suburban district of Chongqing municipality, formerly in Sichuan", "purple cloud (auspicious portent in astrology)", "the Moon (esp. in Daoism)" });
            ("third in order", new List<string> { "Datong or Tiantong (city in Jiangsu province)", "inscrutable twist of fate", "Wenchang City, Hainan", "Lianzhen or Xiangzhen (c. 1380-1229), Northern Song dynasty poet" });
            ("cubes (of food)", new List<string> { "the Moon (esp. in Daoism)", "Datong or Tiantong (city in Jiangsu province)", "inscrutable twist of fate", "great gate" });

            ("fifth in order", new List<string> { "Lupus (star sign)", "the Moon (esp. in Daoism)", "Right Buter", "inscrutable twist of fate" });
            ("hexa", new List<string> { "Wuquan suburban district of Shanghai", "Lupus (star sign)", "Tianliang suburban district of Chongqing municipality, formerly in Sichuan", "literary recreation" });
            ("hepta", new List<string> { "solar", "Wuquan suburban district of Shanghai", "the Moon (esp. in Daoism)", "Datong or Tiantong (city in Jiangsu province)" });
            ("laborious", new List<string> { "great gate", "solar", "literary recreation", "Wenchang City, Hainan" });

            ("ninth in order", new List<string> { "Tianliang suburban district of Chongqing municipality, formerly in Sichuan", "purple cloud (auspicious portent in astrology)", "Zuo Fu", "Wuquan suburban district of Shanghai" });
            ("tenth in order", new List<string> { "a defeat", "great gate", "the Moon (esp. in Daoism)", "Lupus (star sign)" });

            return rDict[tianGan];
        }

Great dividing line.


Phase Summary

So this is it, this is the end of the line? To tell you the truth, yes. But there are still a lot of stars in the beginning of the picture, and they haven't been arranged yet. So, let's see, let's see, let's see. It's very easy to arrange the stars.

 

Andromeda (star)

An Heavenly Punishment: From the first month of the year from the palace of You, counting down to the palace of the birth month, where the palace is located.

An Tian Yao: From the House of Ugly onwards in the first month, counting down to the House of the Birth Moon, the house where it is located is the same.

 

An yin-buster: from the first month to December in the following order: Yin Zishu Shen Wu Chen Yin Zishu Shen Wu Chen.

Regularity: from the first month to June, the first month starts from the c branch, after that, month by month, the earth's branch is reversed every other one, from July to December, repeat the same as before.

Antenna month: from the first month to December in the following order: Shuo Si Chen Yin Wei Mao Hai Wei Yin Wu Wu Shuo Yin.

Antenna Witch: From the first month of the year to December, the order is: Si Shen Hai Yin Si Shen Hai Yin Si Shen Hai Yin.

 

amphibole (astronomy)

An Sky Star: The sky starts from the Oh Palace at the time of birth, and counts backwards to the palace of birth, where the palace is located.

An Di Jiao Xing: Di Jiao is located in the palace where the child is born from the palace of Oh, counting down to the palace of the birth time.

An Tai Auxiliary Star Tips: Starting from the midday palace at the time of the child, and counting down to the time of birth, the palace where it is located is.

Anfeng Kuanxing: From the palace of Yin to the hour of Zi, counting down to the hour of birth, where the palace is located.

 

the Ansang clan of stars in the year of birth

An Heavenly Weeping Star: Heavenly Weeping is located in the house where the year of the child starts from the house of noon, and counts backwards to the year of birth.

An Tianxu star: Tianxu is located in the palace from the midday palace to the year of the son, and counts down to the year of birth.

An Tianma Star: Yin Wu Xiu year horse in the Shen, Shen Zi Chen year horse in the Yin, Si You Ug year horse in the Ohio, Oh U Wei year horse in the Si.

 

An Hongluan star: from the dao house from the son year, reverse counting to the birth year branch, where the house is located is.

AN TIANXI STAR: Tianxi must be in the opposite house of Hongluan.

 

Anlong Chi Xing: From the eon palace in the year of the son, counting down to the end of the birth year's earthly branch, the palace where it is located.

An Fengge star: from the garrison house in the year of the son, counting backwards to the end of the earthly branch of the birth year, the house where it is located.

 

An Hua Gai Xing: Shen Zi Chen year students in the Chen, Oh Mao Wei year in the Wei, Yin Wu Xiu year in the Xiu, Si You U year in the ugly. (Four Grave Palaces)

Anjiao Siren: Shen Zichen year students in the Si, Oh Mao Wei year in the Shen, Yin Wu Xiu year in the Oh, Si You Ugly year in the Yin. (Four Horse Palace)

An Xianchi star: Shen Zichen year born in You, Oh Mao Wei year in Zi, Yin Wu Xiu year in Mao, Si You U year in the afternoon. (Four defeat palace)

An Orphan Star: Yin, Mao, and Chen years in the Si, Si, Wu, and Wei years in the Shen, Shen, You, and Xiu years in the Oh, Oh, Zi, and Ug years in the Yin. (Four Horse Palace)

(Four Grave Palaces)

 

An broken star: Zi Wu D You year students in the Si, Chen Shuo Ug Wei year students in the ugly, Yin Shen Si Hai year students in the You.

An Great Consumption Star: In the year of Zi in the year of Wei, in the year of U in the year of Wu, in the year of Yin in the year of You, in the year of Mao in the year of Shen, in the year of Chen in the year of Hai, in the year of Si in the year of Gio.

In the year of the afternoon in the ugly, in the year of the evening in the son, in the year of the Shen in the Mao, in the year of the You in the Yin, in the year of the garrison in the Si, and in the year of the Ohio in the Chen.

 

An Tian De star: from the palace of You, the year of the child, counting down to the end of the birth year of the Earth's branch, where the palace is located.

Anxie Shenxing: The house in which you are located is the house where you start your son's year from the garrison house and count backwards to the end of your birth year's earthly branch.

 

An Guilian Star: In the year of the son in the Shen, the year of the ugly in the You, the year of the Yin in the garrison, the year of the Mao in the Si, the year of the Chen in the afternoon, the year of the Si in the not yet, the year of the afternoon in the Yin, the year of the not yet in the Mao, the year of the Shen in the Chen, the year of the You in the Ohio, the year of the garrison in the Zi, the year of the Ohio in the Ugly.

 

Year of the Anson (e.g. 2010), year of the Snake (e.g. 2011)

An Luk Chuen star: A Luk in Yin B Luk Mao, C E in Si Ding Hei Wu, G Luk in Shen Xin Luk You, N Luk in Hai Dec Luk Zi.

An Prime Goat Tara: The three stars of the Goat Rok Tara are always linked together, with the Rok in the center, the Goat in the front (the previous digit down the line), and the Tara in the back (the next digit up the line in reverse counting).

 

An Tiankui (Heavenly Kui) and Tianyax (Heavenly Battle-axe): A E G Clown is not yet, B Hei Zi Shen Township, Xin Fung Wu Yin is, C Ding Hei You Bit, Nong Dai Mao Si Zang, this is the Nobleman's Square. (Each sentence of the heavenly stem is the year of birth heavenly stem, the previous earthly branch is the palace where Tiankui is located, and the latter earthly branch is the palace where Tianyax is located).

 

An Tian Guan Xing: Year A is in Wei, Year B is in Chen, Year C is in Si, Year D is in Yin, Year E is in Mao, Year F is in You, Year G is in Hai, Year Xin is in You, Year N is in Gio, Year K is in Wu.

 

An Tian Fu Xing: Year A in You, Year B in Shen, Year C in Zi, Year D in Hai, Year E in Mao, Year F in Yin, Year G in Wu, Year Xin in Si, Year N in Wu, Year D in Si.

 

An interception of the empty star: the year of A and F, Shen You, B and G, Wu Wei, C and S, C and S, D and N, Yin and Mao, E and D, Zi U. Meaning: a year or the year of the cut-off star is Shen and You, and so on. Cut off the empty star is divided into positive empty and vice empty, positive empty power, vice empty power is small. Heavenly stem for the Yang in the Yang Palace of the empty star for the positive empty, in the Yin Palace of the empty star for the secondary empty; Heavenly stem for the Yin in the Yin Palace of the empty star for the positive empty, in the Yang Palace of the empty star for the secondary empty. For example, for a person born in the year A, Shen is the positive void and You is the secondary void; for a person born in the year F, You is the positive void and Shen is the secondary void.

 

An Mars: Yin, Wu and Xio years from the Palace of Ugly, Shen Zichen years from the Palace of Yin, Siyou and Ugly years in the Palace of Mao, Oh, Dawei years from the Palace of You, from the beginning of the Palace of Zi Shi, down the number to the end of the birth of the Palace of the Palace that is.

An Suzu Xing: Yin, Wu and Xiu years from the Palace of the son, Shen Zi Chen, Si You U ugly, Oh U Wei years from the Palace of Xiu from the son, counting down to the birth of the end of the Palace is.

 

An Santai Star: From the left auxiliary star where the house of the first day, along the twelve houses clockwise counting, counting to the end of the day of birth, that is, in this house An Santai Star.

An eight-seat star: From the first day in the house where the star of the Right Hand Buttress is located, counting counterclockwise along the twelve houses, counting to the day of birth, that is, the eight-seat star in this house.

 

An Tian Gui Xing: From the house where Wen Qu Xing is located at the beginning of the day, clockwise counting, counting to the birth day palace and then return to a palace, that is, in this palace An Tian Gui Xing.

An Enlightenment Star: From the beginning of the day in the house where the Wenchang Star is located, counting clockwise, counting to the house of the day of birth and then return to a house, that is, in this house An Enlightenment Star.

 

An Genius Star: Starting from the House of Life and counting clockwise along the twelve houses until the house where the year of birth is located, the Genius Star will be placed in this house.

An Tian Shouxing: From the palace of the body from the son of the year, along the twelve houses clockwise direction, the number to the birth of the year branch of the palace stops, that is, in this palace An Tian Shouxing.

An Ascendant of Heavenly Hurt and Angelic Star: the Ascendant of Heavenly Hurt is fixed in the House of Nuns and the Angelic Star is fixed in the House of Disease.

 

 

The Twelve Gods of Dr. Anson's Year

The star Luk Chuen* heads the house where it is located, the male and female yang are in transit, and the male and female yin are in retrograde.

In order, we place the Doctor, Rex, Green Dragon, Small Consumption, General, Zao Shu, Fei Lien, Joyful God, Sickness Talisman, Great Consumption, Ambush Soldier, and Official Talisman, and place one star in each house.

 

look back

By this point, we have gone through the entire process (except for the shipping limit). The final result is as follows.

 

Throughout the whole process, we can find the entire rules of the platoon, complex and complicated. Among them, we can peep into the hidden depths of the code. For example, the body of the Lord, the left and right Changqu, etc. The secret of the arrangement of the stars is worth digging.

From this we can also appreciate that the ancients arranged a life example hard work. I think, in the current information technology, with the help of big data + artificial intelligence, the traditional Zi Wei Dou Shu, will shine, will also become an important part of the Chinese culture, of which I have no doubt.