56c46c1
Initial Commit LMonan 3 years ago
11 changed file(s) with 1479 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 # Auto detect text files and perform LF normalization
1 * text=auto
0 .idea/
1 *.pyc
2 *.swp
3 .DS_Store
4 /.localenv/
5 /datasets/
6 /.ipynb_checkpoints/
7 core.*
8
0 Apache License
1 Version 2.0, January 2004
2 http://www.apache.org/licenses/
3
4 TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
5
6 1. Definitions.
7
8 "License" shall mean the terms and conditions for use, reproduction,
9 and distribution as defined by Sections 1 through 9 of this document.
10
11 "Licensor" shall mean the copyright owner or entity authorized by
12 the copyright owner that is granting the License.
13
14 "Legal Entity" shall mean the union of the acting entity and all
15 other entities that control, are controlled by, or are under common
16 control with that entity. For the purposes of this definition,
17 "control" means (i) the power, direct or indirect, to cause the
18 direction or management of such entity, whether by contract or
19 otherwise, or (ii) ownership of fifty percent (50%) or more of the
20 outstanding shares, or (iii) beneficial ownership of such entity.
21
22 "You" (or "Your") shall mean an individual or Legal Entity
23 exercising permissions granted by this License.
24
25 "Source" form shall mean the preferred form for making modifications,
26 including but not limited to software source code, documentation
27 source, and configuration files.
28
29 "Object" form shall mean any form resulting from mechanical
30 transformation or translation of a Source form, including but
31 not limited to compiled object code, generated documentation,
32 and conversions to other media types.
33
34 "Work" shall mean the work of authorship, whether in Source or
35 Object form, made available under the License, as indicated by a
36 copyright notice that is included in or attached to the work
37 (an example is provided in the Appendix below).
38
39 "Derivative Works" shall mean any work, whether in Source or Object
40 form, that is based on (or derived from) the Work and for which the
41 editorial revisions, annotations, elaborations, or other modifications
42 represent, as a whole, an original work of authorship. For the purposes
43 of this License, Derivative Works shall not include works that remain
44 separable from, or merely link (or bind by name) to the interfaces of,
45 the Work and Derivative Works thereof.
46
47 "Contribution" shall mean any work of authorship, including
48 the original version of the Work and any modifications or additions
49 to that Work or Derivative Works thereof, that is intentionally
50 submitted to Licensor for inclusion in the Work by the copyright owner
51 or by an individual or Legal Entity authorized to submit on behalf of
52 the copyright owner. For the purposes of this definition, "submitted"
53 means any form of electronic, verbal, or written communication sent
54 to the Licensor or its representatives, including but not limited to
55 communication on electronic mailing lists, source code control systems,
56 and issue tracking systems that are managed by, or on behalf of, the
57 Licensor for the purpose of discussing and improving the Work, but
58 excluding communication that is conspicuously marked or otherwise
59 designated in writing by the copyright owner as "Not a Contribution."
60
61 "Contributor" shall mean Licensor and any individual or Legal Entity
62 on behalf of whom a Contribution has been received by Licensor and
63 subsequently incorporated within the Work.
64
65 2. Grant of Copyright License. Subject to the terms and conditions of
66 this License, each Contributor hereby grants to You a perpetual,
67 worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68 copyright license to reproduce, prepare Derivative Works of,
69 publicly display, publicly perform, sublicense, and distribute the
70 Work and such Derivative Works in Source or Object form.
71
72 3. Grant of Patent License. Subject to the terms and conditions of
73 this License, each Contributor hereby grants to You a perpetual,
74 worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75 (except as stated in this section) patent license to make, have made,
76 use, offer to sell, sell, import, and otherwise transfer the Work,
77 where such license applies only to those patent claims licensable
78 by such Contributor that are necessarily infringed by their
79 Contribution(s) alone or by combination of their Contribution(s)
80 with the Work to which such Contribution(s) was submitted. If You
81 institute patent litigation against any entity (including a
82 cross-claim or counterclaim in a lawsuit) alleging that the Work
83 or a Contribution incorporated within the Work constitutes direct
84 or contributory patent infringement, then any patent licenses
85 granted to You under this License for that Work shall terminate
86 as of the date such litigation is filed.
87
88 4. Redistribution. You may reproduce and distribute copies of the
89 Work or Derivative Works thereof in any medium, with or without
90 modifications, and in Source or Object form, provided that You
91 meet the following conditions:
92
93 (a) You must give any other recipients of the Work or
94 Derivative Works a copy of this License; and
95
96 (b) You must cause any modified files to carry prominent notices
97 stating that You changed the files; and
98
99 (c) You must retain, in the Source form of any Derivative Works
100 that You distribute, all copyright, patent, trademark, and
101 attribution notices from the Source form of the Work,
102 excluding those notices that do not pertain to any part of
103 the Derivative Works; and
104
105 (d) If the Work includes a "NOTICE" text file as part of its
106 distribution, then any Derivative Works that You distribute must
107 include a readable copy of the attribution notices contained
108 within such NOTICE file, excluding those notices that do not
109 pertain to any part of the Derivative Works, in at least one
110 of the following places: within a NOTICE text file distributed
111 as part of the Derivative Works; within the Source form or
112 documentation, if provided along with the Derivative Works; or,
113 within a display generated by the Derivative Works, if and
114 wherever such third-party notices normally appear. The contents
115 of the NOTICE file are for informational purposes only and
116 do not modify the License. You may add Your own attribution
117 notices within Derivative Works that You distribute, alongside
118 or as an addendum to the NOTICE text from the Work, provided
119 that such additional attribution notices cannot be construed
120 as modifying the License.
121
122 You may add Your own copyright statement to Your modifications and
123 may provide additional or different license terms and conditions
124 for use, reproduction, or distribution of Your modifications, or
125 for any such Derivative Works as a whole, provided Your use,
126 reproduction, and distribution of the Work otherwise complies with
127 the conditions stated in this License.
128
129 5. Submission of Contributions. Unless You explicitly state otherwise,
130 any Contribution intentionally submitted for inclusion in the Work
131 by You to the Licensor shall be under the terms and conditions of
132 this License, without any additional terms or conditions.
133 Notwithstanding the above, nothing herein shall supersede or modify
134 the terms of any separate license agreement you may have executed
135 with Licensor regarding such Contributions.
136
137 6. Trademarks. This License does not grant permission to use the trade
138 names, trademarks, service marks, or product names of the Licensor,
139 except as required for reasonable and customary use in describing the
140 origin of the Work and reproducing the content of the NOTICE file.
141
142 7. Disclaimer of Warranty. Unless required by applicable law or
143 agreed to in writing, Licensor provides the Work (and each
144 Contributor provides its Contributions) on an "AS IS" BASIS,
145 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146 implied, including, without limitation, any warranties or conditions
147 of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148 PARTICULAR PURPOSE. You are solely responsible for determining the
149 appropriateness of using or redistributing the Work and assume any
150 risks associated with Your exercise of permissions under this License.
151
152 8. Limitation of Liability. In no event and under no legal theory,
153 whether in tort (including negligence), contract, or otherwise,
154 unless required by applicable law (such as deliberate and grossly
155 negligent acts) or agreed to in writing, shall any Contributor be
156 liable to You for damages, including any direct, indirect, special,
157 incidental, or consequential damages of any character arising as a
158 result of this License or out of the use or inability to use the
159 Work (including but not limited to damages for loss of goodwill,
160 work stoppage, computer failure or malfunction, or any and all
161 other commercial damages or losses), even if such Contributor
162 has been advised of the possibility of such damages.
163
164 9. Accepting Warranty or Additional Liability. While redistributing
165 the Work or Derivative Works thereof, You may choose to offer,
166 and charge a fee for, acceptance of support, warranty, indemnity,
167 or other liability obligations and/or rights consistent with this
168 License. However, in accepting such obligations, You may act only
169 on Your own behalf and on Your sole responsibility, not on behalf
170 of any other Contributor, and only if You agree to indemnify,
171 defend, and hold each Contributor harmless for any liability
172 incurred by, or claims asserted against, such Contributor by reason
173 of your accepting any such warranty or additional liability.
174
175 END OF TERMS AND CONDITIONS
176
177 APPENDIX: How to apply the Apache License to your work.
178
179 To apply the Apache License to your work, attach the following
180 boilerplate notice, with the fields enclosed by brackets "[]"
181 replaced with your own identifying information. (Don't include
182 the brackets!) The text should be enclosed in the appropriate
183 comment syntax for the file format. We also recommend that a
184 file or class name and description of purpose be included on the
185 same "printed page" as the copyright notice for easier
186 identification within third-party archives.
187
188 Copyright [yyyy] [name of copyright owner]
189
190 Licensed under the Apache License, Version 2.0 (the "License");
191 you may not use this file except in compliance with the License.
192 You may obtain a copy of the License at
193
194 http://www.apache.org/licenses/LICENSE-2.0
195
196 Unless required by applicable law or agreed to in writing, software
197 distributed under the License is distributed on an "AS IS" BASIS,
198 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
199 See the License for the specific language governing permissions and
200 limitations under the License.
0 # YI
1 周易占卦解卦程序(纯娱乐)。
2
3 https:////www.cnblogs.com/lsdb/p/12444143.html
0 ## 介绍 (Introduction)
1
2 添加该项目的功能、使用场景和输入输出参数等相关信息。
3
4 You can describe the function, usage and parameters of the project.
0 {
1 "cells": [
2 {
3 "cell_type": "markdown",
4 "metadata": {},
5 "source": [
6 "## 1. 项目介绍\n",
7 "\n",
8 " - 项目是由模块组成、有特定功能的程序。它能够满足用户的直接使用需求,例如[古诗词生成器](https://momodel.cn/explore/5bfb634e1afd943c623dd9cf?type=app&tab=1)、[风格迁移](https://momodel.cn/explore/5bfb634e1afd943c623dd9cf?type=app&tab=1)等。\n",
9 " - 开发项目过程中你可以导入数据集,也可以通过每个 cell 上方工具栏的`<+>`直接插入[模块](https://momodel.cn/modules)和代码块。\n",
10 " - 你可以将开发好的项目进行[部署](https://momodel.cn/docs/#/zh-cn/%E5%BC%80%E5%8F%91%E5%92%8C%E9%83%A8%E7%BD%B2%E4%B8%80%E4%B8%AA%E9%A1%B9%E7%9B%AE),项目部署成功并选择正式版本发布后会展示在“项目”页面,用户可以在线使用,也可以通过 API 调用。\n",
11 "\n",
12 " - 项目目录结构:\n",
13 "\n",
14 " - ```results```*-----结果的文件存放地(如果你运行 job,务必将运行结果指定在此目录)*\n",
15 " - ```_OVERVIEW.md``` *-----项目的相关介绍*\n",
16 " - ```_README.md```*-----说明文档*\n",
17 " - ```app_spec.yml```*-----定义项目的输入输出,为部署服务*\n",
18 " - ```coding_here.ipynb```*-----输入并运行代码*"
19 ]
20 },
21 {
22 "cell_type": "markdown",
23 "metadata": {},
24 "source": [
25 "\n",
26 "## 2. 开发环境简介\n",
27 "\n",
28 "你当前所在的页面 Notebook 是一个内嵌 JupyterLab 的在线类 IDE 编程环境,开发过程中可以使用页面右侧的 API 文档进行快速查询。Notebook 有以下主要功能:\n",
29 "\n",
30 "- [调用数据集、模块和代码块资源](https://momodel.cn/docs/#/zh-cn/%E5%A6%82%E4%BD%95%E5%AF%BC%E5%85%A5%E5%B9%B6%E4%BD%BF%E7%94%A8%E6%A8%A1%E5%9D%97%E5%92%8C%E6%95%B0%E6%8D%AE%E9%9B%86)\n",
31 "- [多人代码协作](https://momodel.cn/docs/#/zh-cn/%E5%9C%A8Mo%E8%BF%90%E8%A1%8C%E4%BD%A0%E7%9A%84%E7%AC%AC%E4%B8%80%E6%AE%B5%E4%BB%A3%E7%A0%81?id=_7-%e4%bd%a0%e5%8f%af%e4%bb%a5%e9%82%80%e8%af%b7%e5%a5%bd%e5%8f%8b%e8%bf%9b%e8%a1%8c%e5%8d%8f%e4%bd%9c)\n",
32 "- [在 GPU 资源上训练机器学习模型](https://momodel.cn/docs/#/zh-cn/%E5%9C%A8GPU%E6%88%96CPU%E8%B5%84%E6%BA%90%E4%B8%8A%E8%AE%AD%E7%BB%83%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E6%A8%A1%E5%9E%8B)\n",
33 "- [简单部署](https://momodel.cn/docs/#/zh-cn/%E5%BC%80%E5%8F%91%E5%92%8C%E9%83%A8%E7%BD%B2%E4%B8%80%E4%B8%AA%E9%A1%B9%E7%9B%AE)\n",
34 "\n",
35 "快来动手试试吧!点击左侧工具栏的新建文件图标即可选择你需要的文件类型。\n",
36 "\n",
37 "<img src='https://imgbed.momodel.cn/006tNc79gy1g61agfcv23j31c30u0789.jpg' width=100% height=100%>\n",
38 "\n",
39 "\n",
40 "\n",
41 "左侧和右侧工具栏都可根据使用需要进行收合。\n",
42 "<img src='https://imgbed.momodel.cn/collapse_tab.2019-09-06 11_07_44.gif' width=100% height=100%>"
43 ]
44 },
45 {
46 "cell_type": "markdown",
47 "metadata": {},
48 "source": [
49 "## 3. 快捷键与代码补全\n",
50 "Mo Notebook 已完全采用 Jupyter Notebook 的原生快捷键,并且支持 `tab` 代码补全。\n",
51 "\n",
52 "运行代码:`shift` + `enter` 或者 `shift` + `return`"
53 ]
54 },
55 {
56 "cell_type": "markdown",
57 "metadata": {},
58 "source": [
59 "## 4. 常用指令介绍\n",
60 "\n",
61 "- 解压上传后的文件\n",
62 "\n",
63 "在 cell 中输入并运行以下命令:\n",
64 "```!7zx file_name.zip```\n",
65 "\n",
66 "- 查看所有包(package)\n",
67 "\n",
68 "`!pip list --format=columns`\n",
69 "\n",
70 "- 检查是否已有某个包\n",
71 "\n",
72 "`!pip show package_name`\n",
73 "\n",
74 "- 安装缺失的包\n",
75 "\n",
76 "`!pip install package_name`\n",
77 "\n",
78 "- 更新已有的包\n",
79 "\n",
80 "`!pip install package_name --upgrade`\n",
81 "\n",
82 "\n",
83 "- 使用包\n",
84 "\n",
85 "`import package_name`\n",
86 "\n",
87 "- 显示当前目录下的档案及目录\n",
88 "\n",
89 "`ls`\n",
90 "\n",
91 "- 使用引入的数据集\n",
92 "\n",
93 "数据集被引入后存放在 datasets 文件夹下,注意,这个文件夹是只读的,不可修改。如果需要修改,可在 Notebook 中使用\n",
94 "\n",
95 "`!cp -R ./datasets/<imported_dataset_dir> ./<your_folder>`\n",
96 "\n",
97 "指令将其复制到其他文件夹后再编辑,对于引入的数据集中的 zip 文件,可使用\n",
98 "\n",
99 "`!7zx ./datasets/<imported_dataset_dir>/<XXX.zip> ./<your_folder>`\n",
100 "\n",
101 "指令解压缩到其他文件夹后使用"
102 ]
103 },
104 {
105 "cell_type": "markdown",
106 "metadata": {},
107 "source": [
108 "## 5. 其他可参考资源\n",
109 "\n",
110 "- [帮助文档](https://momodel.cn/docs/#/):基本页面介绍和常见问题都可以在里面找到\n",
111 "- [平台功能教程](https://momodel.cn/classroom/class/5c5696cd1afd9458d456bf54):通过图文结合的 Notebook 详细介绍开发环境基本功能和操作\n",
112 "- [从 Python 到人工智能](https://momodel.cn/classroom/course/detail?&id=60f02c635076ff487bce4c6f):超易入门的 Python 课程\n",
113 "- [吴恩达机器学习](https://momodel.cn/classroom/class/5c5696191afd94720cc94533):机器学习经典课程\n",
114 "- [李宏毅机器学习](https://momodel.cn/classroom/class/5d63dde21afd9461419f5ebf):中文世界最好的机器学习课程\n",
115 "- [机器学习实战](https://momodel.cn/classroom/class/60af61b6f955c61c2cddfcb5):通过实操指引完成独立的模型,掌握相应的机器学习知识\n",
116 "- [深度学习实战](https://momodel.cn/classroom/class/5c680b311afd943a9f70901b):通过实操指引完成独立的模型,掌握相应的深度学习知识\n",
117 "- [模块开发](https://momodel.cn/modules):关于模型训练、开发与部署的高阶教程"
118 ]
119 }
120 ],
121 "metadata": {
122 "kernelspec": {
123 "display_name": "Python 3",
124 "language": "python",
125 "name": "python3"
126 },
127 "language_info": {
128 "codemirror_mode": {
129 "name": "ipython",
130 "version": 3
131 },
132 "file_extension": ".py",
133 "mimetype": "text/x-python",
134 "name": "python",
135 "nbconvert_exporter": "python",
136 "pygments_lexer": "ipython3",
137 "version": "3.5.2"
138 },
139 "pycharm": {
140 "stem_cell": {
141 "cell_type": "raw",
142 "source": [],
143 "metadata": {
144 "collapsed": false
145 }
146 }
147 }
148 },
149 "nbformat": 4,
150 "nbformat_minor": 2
151 }
0
1 {
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": null,
6 "metadata": {},
7 "outputs": [],
8 "source": [
9 "print('Hello Mo!')"
10 ]
11 }
12 ],
13 "metadata": {
14 "kernelspec": {
15 "display_name": "Python 3",
16 "language": "python",
17 "name": "python3"
18 },
19 "language_info": {
20 "codemirror_mode": {
21 "name": "ipython",
22 "version": 3
23 },
24 "file_extension": ".py",
25 "mimetype": "text/x-python",
26 "name": "python",
27 "nbconvert_exporter": "python",
28 "pygments_lexer": "ipython3",
29 "version": "3.5.2"
30 }
31 },
32 "nbformat": 4,
33 "nbformat_minor": 2
34 }
35
0 Please store your training checkpoints or results here
1 请在此处存储 checkpoints 和结果文件
0 Please store your tensorboard results here
1 请在此处存储 tensorboard 结果
+166
-0
yi.py less more
0 import random
1 import datetime
2 from yi_book import book
3
4
5 class YiProgram():
6 def __init__(self):
7 pass
8
9 # 设置随机数种子,确保用户输入一样时,得到的随机数是一样的
10 def _set_random_seed(self, time_seed_str):
11 def _transfer_str_to_time_seed():
12 user_input_str_bytes = time_seed_str.encode()
13 inner_random_seed = 0
14 for tmp_byte in user_input_str_bytes:
15 inner_random_seed += tmp_byte
16 return inner_random_seed
17 random_seed = _transfer_str_to_time_seed()
18 random.seed(random_seed)
19
20 # 执行一轮变化
21 def _exec_one_transfer(self, cosmos_count):
22 # 第一步,将四十九颗棋子随机分为左右两组,象征混沌初开,天地一分为二,一边为天,一边为地。
23 cosmos_list = [1] * cosmos_count
24 divide_index = random.randint(int(cosmos_count/3), int(cosmos_count/3)*2)
25 sky_list = cosmos_list[:divide_index]
26 land_list = cosmos_list[divide_index:]
27 # 第二步,有天有地就该有人,所以任意拿掉一组中的一个棋子,这颗棋子便为人。然后形成三才。
28 person_point = random.randint(0,cosmos_count)
29 if person_point < divide_index:
30 sky_list.pop()
31 else:
32 land_list.pop()
33 # 第三步,以象征天的那组棋子数除以四,获得余数,如果整除则余数改为4(这里的四象征着一年四季)。
34 sky_remainder = len(sky_list) % 4
35 if sky_remainder == 0:
36 sky_remainder = 4
37 # sky_list = sky_list[:-sky_remainder]
38 # 第四步,对象征地的那组进行同样的操作。
39 land_remainder = len(land_list) % 4
40 if land_remainder == 0:
41 land_remainder = 4
42 # land_list = land_list[:-land_remainder]
43 # 第五步,减去象征人的棋子及两组的余数,获取剩余的棋子数
44 remove_count = 1 + sky_remainder + land_remainder
45 cosmos_count = cosmos_count - remove_count
46 return cosmos_count
47
48 # 递规执行三轮变化获取剩余的棋子数,即一爻
49 def _gen_one_symbol(self, cosmos_count=49, transfer_index=0):
50 cosmos_count = self._exec_one_transfer(cosmos_count)
51 transfer_index += 1
52 if transfer_index >= 3:
53 return cosmos_count
54 else:
55 return self._gen_one_symbol(cosmos_count=cosmos_count, transfer_index=transfer_index)
56
57 # 获取六爻,组成本卦
58 def _gen_origin_hexagram(self):
59 six_symbol_list = []
60 for symbol_index in range(6):
61 tmp_symbol = int(self._gen_one_symbol() / 4)
62 six_symbol_list.append(tmp_symbol)
63 return six_symbol_list
64
65 # 根据本卦获取变卦
66 def _gen_support_hexagram(self, origin_hexagram):
67 support_hexagram = []
68 for tmp_value in origin_hexagram:
69 if tmp_value == 6:
70 tmp_value = 9
71 elif tmp_value == 9:
72 tmp_value = 6
73 support_hexagram.append(tmp_value)
74 return support_hexagram
75
76 # 分析变爻数及变爻下标列表
77 def _get_turn_symbol_count_and_index_list(self, origin_hexagram, support_hexagram):
78 turn_symbol_count = 0
79 turn_symbol_index_list = []
80 not_turn_symbol_index_list = []
81 for index in range(len(origin_hexagram)):
82 if origin_hexagram[index] != support_hexagram[index]:
83 turn_symbol_count += 1
84 turn_symbol_index_list.append(index)
85 else:
86 not_turn_symbol_index_list.append(index)
87 return turn_symbol_count,turn_symbol_index_list,not_turn_symbol_index_list
88
89 # 偶数为阴,奇数为阳
90 def _get_hexagram_dict_key(self, hexagram):
91 hexagram_dict_key = ""
92 for tmp_value in hexagram:
93 hexagram_dict_key += str(tmp_value % 2)
94 return hexagram_dict_key
95
96 # 解卦
97 def _parser_hexagram(self, origin_hexagram, support_hexagram):
98 main_indicate = ""
99 support_indicate = ""
100 turn_symbol_desc = ""
101 origin_hexagram_dict_key = self._get_hexagram_dict_key(origin_hexagram)
102 support_hexagram_dict_key = self._get_hexagram_dict_key(support_hexagram)
103 turn_symbol_count,turn_symbol_index_list,not_turn_symbol_index_list = self._get_turn_symbol_count_and_index_list(origin_hexagram, support_hexagram)
104 # 六爻皆不变者,占本卦卦辞
105 if turn_symbol_count == 0:
106 turn_symbol_desc = "六爻皆不变者,占本卦卦辞。"
107 main_indicate = book[origin_hexagram_dict_key]["indicate"][0]
108 # 一爻变者,以本卦变爻之辞占
109 elif turn_symbol_count == 1:
110 turn_symbol_desc = "一爻变者,以本卦变爻之辞占。"
111 main_indicate = book[origin_hexagram_dict_key]["indicate"][turn_symbol_index_list[0]+1]
112 # 二爻变者,则以本卦二变爻之辞占,而以上爻之辞为主
113 elif turn_symbol_count == 2:
114 turn_symbol_desc = "二爻变者,则以本卦二变爻之辞占,而以上爻之辞为主。"
115 main_indicate = book[origin_hexagram_dict_key]["indicate"][turn_symbol_index_list[1]+1]
116 support_indicate = book[origin_hexagram_dict_key]["indicate"][turn_symbol_index_list[0]+1]
117 # 三爻变者,占本卦及之卦的卦辞,而以本卦为主
118 elif turn_symbol_count == 3:
119 turn_symbol_desc = "三爻变者,占本卦及之卦的卦辞,而以本卦为主。"
120 main_indicate = book[origin_hexagram_dict_key]["indicate"][0]
121 support_indicate = book[support_hexagram_dict_key]["indicate"][0]
122 # 四爻变者,以之卦中二不变之爻辞占,以下爻为主
123 elif turn_symbol_count == 4:
124 turn_symbol_desc = "四爻变者,以之卦中二不变之爻辞占,以下爻为主。"
125 main_indicate = book[origin_hexagram_dict_key]["indicate"][not_turn_symbol_index_list[0]+1]
126 support_indicate = book[origin_hexagram_dict_key]["indicate"][not_turn_symbol_index_list[1]+1]
127 # 五爻变者,以之卦中不变爻的爻辞占
128 elif turn_symbol_count == 5:
129 turn_symbol_desc = "五爻变者,以之卦中不变爻的爻辞占。"
130 main_indicate = book[origin_hexagram_dict_key]["indicate"][not_turn_symbol_index_list[0]+1]
131 # 六爻皆变者,以乾坤二用之辞占,并参考其之卦卦辞
132 elif turn_symbol_count == 6:
133 turn_symbol_desc = "六爻皆变者,以乾坤二用之辞占,并参考其之卦卦辞。"
134 main_indicate = book[origin_hexagram_dict_key]["indicate"][7]
135 support_indicate = book[support_hexagram_dict_key]["indicate"][0]
136 return turn_symbol_desc,main_indicate,support_indicate
137
138 def main_logic_new(self):
139 user_wish = input("请输入你所求之事:")
140 user_pray = input(f"请输入你的祈祷:")
141 today = datetime.datetime.now().__format__("%Y%m%d")
142 time_seed_str = user_wish + user_pray + today
143 # 设置随机数种子,确保当天同样的输出得到的结果是一样的
144 self._set_random_seed(time_seed_str)
145 print("\n稍等,正在计算卦象...")
146 # 生成本卦
147 origin_hexagram = self._gen_origin_hexagram()
148 # 计算变卦
149 support_hexagram = self._gen_support_hexagram(origin_hexagram)
150 # 本卦对应的内容的key
151 origin_hexagram_dict_key = self._get_hexagram_dict_key(origin_hexagram)
152 # 变卦对应的内容的key
153 support_hexagram_dict_key = self._get_hexagram_dict_key(support_hexagram)
154 print(f"本卦:{origin_hexagram}--{book[origin_hexagram_dict_key]['name']}--{book[origin_hexagram_dict_key]['come_from']}\n"
155 f"变卦:{support_hexagram}--{book[support_hexagram_dict_key]['name']}--{book[support_hexagram_dict_key]['come_from']}")
156 print("\n稍等,正在解卦...")
157 # 解卦
158 turn_symbol_desc, main_indicate, support_indicate = self._parser_hexagram(origin_hexagram, support_hexagram)
159 print(f"说明:{turn_symbol_desc}\n"
160 f"主预言:{main_indicate}\n"
161 f"辅预言:{support_indicate}")
162
163 if __name__ == "__main__":
164 obj = YiProgram()
165 obj.main_logic_new()
0 book = {
1 "111111": {
2 "name": "乾【卦一】乾为天",
3 "come_from": "乾上乾下",
4 "indicate":[
5 "乾,元亨利贞。",
6 "初九:潜龙,勿用。",
7 "九二:见龙在田,利见大人。",
8 "九三:君子终日乾乾,夕惕若,厉,无咎。",
9 "九四:或跃在渊,无咎。",
10 "九五:飞龙在天,利见大人。",
11 "上九:亢龙,有悔。",
12 "用九:见群龙无首,吉。",
13 ],
14 "explain_detail": ""
15 },
16 "000000": {
17 "name": "坤【卦二】坤为地",
18 "come_from": "坤下坤上",
19 "indicate":[
20 "坤,元亨,利牝马之贞。君子有攸往,先迷后得主。利西南得朋,东北丧朋。安贞吉。",
21 "初六:履霜,坚冰至。",
22 "六二:直方,大,不习,无不利。",
23 "六三:含章可贞。或从王事,无成有终。",
24 "六四:括囊,无咎无誉。",
25 "六五:黄裳,元吉。",
26 "上六:龙战于野,其血玄黄。",
27 "用六:利永贞。",
28 ],
29 "explain_detail": ""
30 },
31 "100010": {
32 "name": "屯【卦三】水雷屯",
33 "come_from": "震上坎下",
34 "indicate":[
35 "屯,元亨,利贞。勿用有攸往,利建侯。",
36 "初九:磐桓。利居贞,利建侯。",
37 "六二:屯如邅如,乘马班如。匪寇婚媾。女子贞不字,十年乃字。",
38 "六三:即鹿无虞,惟入于林中。君子几,不如舍。往吝。",
39 "六四:乘马班如,求婚媾。往吉,无不利。",
40 "九五:屯其膏。小贞吉,大贞凶。",
41 "上六:乘马班如,泣血涟如。",
42 ],
43 "explain_detail": ""
44 },
45 "010001": {
46 "name": "蒙【卦四】山水蒙",
47 "come_from": "坎下艮上",
48 "indicate":[
49 "蒙,亨。匪我求童蒙,童蒙求我。初筮告,再三渎,渎则不告。利贞。",
50 "初六:发蒙。利用刑人,用说桎梏。以往吝。",
51 "九二:包蒙,吉。纳妇吉,子克家",
52 "六三:勿用取女,见金夫不有躬。无攸利",
53 "六四:困蒙,吝。",
54 "六五:童蒙,吉。",
55 "上九:击蒙。不利为寇,利御寇。",
56 ],
57 "explain_detail": ""
58 },
59 "111010": {
60 "name": "需【卦五】水天需",
61 "come_from": "乾下坎上",
62 "indicate":[
63 "需,有孚,光亨,贞吉。利涉大川。",
64 "初九:需于郊,利用恒,无咎。",
65 "九二:需于沙,小有言,终吉。",
66 "九三:需于泥,致寇至。",
67 "六四:需于血,出自穴。",
68 "九五:需于酒食,贞吉。",
69 "上六:入于穴,有不带之客三人来,敬之终吉。",
70 ],
71 "explain_detail": ""
72 },
73 "010111": {
74 "name": "讼【卦六】天水讼",
75 "come_from": "坎下乾上",
76 "indicate":[
77 "讼,有孚窒惕,中吉,终凶。利见大人,不利涉大川。",
78 "初六:不永所事,小有言,终吉。",
79 "九二:不克讼,归而逋。其邑人三百户,元眚。",
80 "六三:依旧德,贞厉,终吉。或从王事,无成。",
81 "九四:不克讼,复即命,渝安贞,吉。",
82 "九五:讼,元吉。",
83 "上九:或锡之鞶带,终朝三褫之。",
84 ],
85 "explain_detail": ""
86 },
87 "010000": {
88 "name": "师【卦七】地水师",
89 "come_from": "坎下坤上",
90 "indicate":[
91 "师,贞,丈人吉。无咎。",
92 "初六:师出以律,否藏凶。",
93 "九二:在师中,吉,无咎。王三锡命。",
94 "六三:师或舆尸,凶。",
95 "六四:师左次,无咎。",
96 "六五:田有禽,利执言,无咎。长子帅师,第子舆尸。贞凶。",
97 "上六:大君有命,开国承家,小人勿用。",
98 ],
99 "explain_detail": ""
100 },
101 "000010": {
102 "name": "比【卦八】水地比",
103 "come_from": "坤下坎上",
104 "indicate":[
105 "比,吉。原筮,元永贞,无咎。不宁方来,后夫凶。",
106 "初六:有孚,比之,无咎。有孚盈缶,终来有它,吉。",
107 "六二:比之有内,贞吉。",
108 "六三:比之匪人。",
109 "六四:外比之,贞吉。",
110 "九五:显比。王用三驱失前禽。邑人不诫,吉。",
111 "上六:比之无首,凶。",
112 ],
113 "explain_detail": ""
114 },
115 "111011": {
116 "name": "小畜【卦九】风天小畜",
117 "come_from": "乾下巽上",
118 "indicate":[
119 "小畜,亨。密云水雨,自我西郊。",
120 "初九:复自道,何其咎?吉。",
121 "九二:牵复,吉。",
122 "九三:舆说fu,夫妻反目。",
123 "六四:有孚,血云惕出,无咎。",
124 "九五:有孚挛如,富以其邻。",
125 "上九:既雨既处,尚德载,妇贞厉,月几望,君子征凶。",
126 ],
127 "explain_detail": ""
128 },
129 "110111": {
130 "name": "履【卦十】天泽履",
131 "come_from": "兑下乾上",
132 "indicate":[
133 "履:履虎尾,不咥人。亨。",
134 "初九:素履往,无咎。",
135 "九二:履道坦坦,幽人贞吉。",
136 "六三:眇能视,跛能履。履虎尾,咥人,凶。武人为于大君。",
137 "九四:履虎尾,愬愬终吉。",
138 "九五:夬履,贞厉。",
139 "上九:视履考详,其旋元吉。",
140 ],
141 "explain_detail": ""
142 },
143 "111000": {
144 "name": "泰【卦十五】地天泰",
145 "come_from": "乾下坤上",
146 "indicate":[
147 "泰,小往大来,吉,亨。",
148 "初九:拔茅茹,以其汇,征吉。",
149 "九二:包荒,用冯河,不遐遗,朋亡。复尚于中行。",
150 "九三:无平不陂,无往不复。艰贞无咎。勿恤其孚,于食有福。",
151 "六四:翩翩,不富以其邻,不戒以孚。",
152 "六五:帝乙归妹,以祉,元吉。",
153 "上六:城复于隍,勿用师,自邑告命。贞吝。",
154 ],
155 "explain_detail": ""
156 },
157 "000111": {
158 "name": "否【卦十二】天地否",
159 "come_from": "坤下乾上",
160 "indicate":[
161 "否,否之匪人,不利君子贞。大往小来。",
162 "初六:拔茅茹,以其汇。贞吉亨。",
163 "六二:包承。小人吉,大人否亨。",
164 "六三:包羞。",
165 "九四:有命无咎,畴离祉。",
166 "九五:休否,大人吉。其亡其亡,系于苞桑。",
167 "上九:倾否,先否后喜。",
168 ],
169 "explain_detail": ""
170 },
171 "101111": {
172 "name": "同人【卦十三】天火同人",
173 "come_from": "离下乾上",
174 "indicate":[
175 "同人,同人于野,亨,利涉大川。利君子贞。",
176 "初九:同人于门,无咎。",
177 "六二:同人于宗,吝。",
178 "九三:伏戎于莽。升其高陵,三岁不兴。",
179 "九四:乘其墉,弗克攻,吉。",
180 "九五:同人先号啕而后笑。大师克相遇。",
181 "上九:同人于郊,无悔。",
182 ],
183 "explain_detail": ""
184 },
185 "111101": {
186 "name": "大有【卦十四】火天大有",
187 "come_from": "乾下离上",
188 "indicate":[
189 "大有,元亨。",
190 "初九:无交害,匪咎。艰则无咎。",
191 "九二:大车以载,有攸往,无咎。",
192 "九三:公用亨于天子,小人弗克。",
193 "九四:匪其尪,无咎。",
194 "六五:厥孚交如,威如,吉。",
195 "上九:自天佑之。吉,无不利。",
196 ],
197 "explain_detail": ""
198 },
199 "001000": {
200 "name": "谦【卦十五】地山谦",
201 "come_from": "艮下坤上",
202 "indicate":[
203 "谦,亨,君子有终。",
204 "初六:谦谦君子,用涉大川,吉。",
205 "六二:鸣谦,贞吉。",
206 "九三:劳谦,君子有终,吉。",
207 "六四:无不利,hui谦。",
208 "六五:不富以其邻。利用侵代,无不利。",
209 "上六:鸣谦。利用行师,征邑国。",
210 ],
211 "explain_detail": ""
212 },
213 "000100": {
214 "name": "豫【卦十六】雷地豫",
215 "come_from": "坤下震上",
216 "indicate":[
217 "豫,利建侯行师。",
218 "初六:鸣豫,凶。",
219 "六二:介于石。不终日,贞吉。",
220 "六三:盱豫悔,迟有悔。",
221 "九四:由豫,大有得。勿疑,朋盍簪。",
222 "六五:贞疾,恒不死。",
223 "上六:冥豫,成有渝,无咎。",
224 ],
225 "explain_detail": ""
226 },
227 "100110": {
228 "name": "随【卦十七】泽雷随",
229 "come_from": "震下兑上",
230 "indicate":[
231 "随,元亨,利贞。无咎。",
232 "初九:官有渝,贞吉。出门交有功。",
233 "六二:系小子,失丈夫。",
234 "六三:系丈夫,失小子。随有求得。利居贞。",
235 "九四:随有获,贞凶。有孚在道,以明,何咎?",
236 "九五:孚于嘉,吉。",
237 "上六:拘系之,乃从维之。王用亨于西山。",
238 ],
239 "explain_detail": ""
240 },
241 "011001": {
242 "name": "蛊【卦十八】山风蛊",
243 "come_from": "巽下艮上",
244 "indicate":[
245 "蛊,元亨,利涉大川。先甲三日,后甲三日。",
246 "初六:干父之蛊,有子,考无咎,厉终吉。",
247 "九二:干母之蛊,不可贞。",
248 "九三:干父之蛊,小有悔,无大咎。",
249 "六四:裕父之蛊,往见吝。",
250 "六五:干父之蛊,用誉。",
251 "上九:不事王侯,高尚其事。",
252 ],
253 "explain_detail": ""
254 },
255 "110000": {
256 "name": "临【卦十九】地泽临",
257 "come_from": "兑下坤上",
258 "indicate":[
259 "临,元亨,利贞,至于八月有凶。",
260 "初九:咸临,贞吉。",
261 "九二:咸临,吉,无不利。",
262 "六三:甘临,无攸利。既忧之,无咎。",
263 "六四:至临,无咎。",
264 "六五:知临,大君之宜,吉。",
265 "上六:敦临,吉,无咎。",
266 ],
267 "explain_detail": ""
268 },
269 "000011": {
270 "name": "观【卦二十】风地观",
271 "come_from": "坤下巽上",
272 "indicate":[
273 "观,盥而不荐。有孚颙若。",
274 "初六:童观,小人无咎,君子吝。",
275 "六二:窥观,利女贞。",
276 "六三:观我生。进退。",
277 "六四:观国之光。利用宾于王。",
278 "九五:观我生,君子无咎。",
279 "上九:观其生,君子无咎。",
280 ],
281 "explain_detail": ""
282 },
283 "100101": {
284 "name": "噬嗑[卦二十一]火雷噬嗑",
285 "come_from": "离上震下",
286 "indicate":[
287 "《噬嗑》:亨。利用狱。",
288 "初九,屦校灭趾,无咎。",
289 "六二,噬肤灭鼻,无咎。",
290 "六三,噬腊肉遇毒,小吝,无咎。",
291 "九四,「噬干胏,得金矢。利艰贞,吉。",
292 "六五,噬乾肉得黄金。贞厉,无咎。",
293 "上九,何校灭耳,凶。",
294 ],
295 "explain_detail": ""
296 },
297 "101001": {
298 "name": "贲【卦二十二】山火贲",
299 "come_from": "艮上离下",
300 "indicate":[
301 "《贲》:亨。小利有攸往。",
302 "初九,贲其趾,舍车而徒。",
303 "六二,贲其须。",
304 "九三,贲如,濡如,永贞吉。",
305 "六四,贲如皤如,白马翰如。匪寇,婚媾。",
306 "六五,贲于丘园,束帛戋戋,吝,终吉。",
307 "上九,白贲,无咎。",
308 ],
309 "explain_detail": ""
310 },
311 "000001": {
312 "name": "剥[卦二十三】山地剥",
313 "come_from": "艮上坤下",
314 "indicate":[
315 "《剥》:不利有攸往。",
316 "初六:剥床以足,蔑贞凶。",
317 "六二:剥床以辨,蔑贞凶。",
318 "六三:剥之,无咎。",
319 "六四:剥床以肤,凶。",
320 "六五:贯鱼以宫人宠,无不利。",
321 "上九:硕果不食,君子得舆,小人剥庐。",
322 ],
323 "explain_detail": ""
324 },
325 "100000": {
326 "name": "复【卦二十四】地雷复",
327 "come_from": "坤上震下",
328 "indicate":[
329 "《复》:亨。出入无疾。朋来无咎。反覆其道,七日来复,利有攸往。",
330 "初九,不远复,无祗悔,元吉。",
331 "六二,休复,吉。",
332 "六三,频复,厉,无咎。",
333 "六四,中行独复。",
334 "六五,敦复,无悔。",
335 "上六,迷复,凶,有灾眚。用行师,终有大败,以其国君凶,至于十年不克征。",
336 ],
337 "explain_detail": ""
338 },
339 "100111": {
340 "name": "无妄【卦二十五】天雷无妄",
341 "come_from": "乾上震下",
342 "indicate":[
343 "《无妄》:元亨,利贞。其匪正有眚,不利有攸往。",
344 "初九,无妄往,吉。",
345 "六二,不耕获,不菑畲,则利用攸往。",
346 "六三,无妄之灾,或系之牛,行人之得,邑人之灾。",
347 "九四,可贞。无咎。",
348 "九五,无妄之疾,勿药有喜。",
349 "上九,无妄行,有眚,无攸利。",
350 ],
351 "explain_detail": ""
352 },
353 "111001": {
354 "name": "大畜【卦二十六】山天大畜",
355 "come_from": "艮上乾下",
356 "indicate":[
357 "《大畜》:利贞。不家食吉。利涉大川。",
358 "初九,有厉,利已。",
359 "九二,舆说輹",
360 "九三,良马逐,利艰贞,曰闲舆卫,利有攸往。",
361 "六四,童牛之牿,元吉。",
362 "六五,豶豕之牙,吉。",
363 "上九,何天之衢,亨。",
364 ],
365 "explain_detail": ""
366 },
367 "100001": {
368 "name": "颐【卦二十七】山雷颐",
369 "come_from": "艮上震下",
370 "indicate":[
371 "《颐》:贞吉。观颐,自求口实。",
372 "初九,舍尔灵龟,观我朵颐,凶。",
373 "六二,颠颐拂经于丘颐,征凶。",
374 "六三,拂颐,贞凶,十年勿用,无攸利。",
375 "六四,颠颐,吉。虎视眈眈,其欲逐逐,无咎。",
376 "六五,拂经,居贞吉,不可涉大川。",
377 "上九,由颐,厉,吉。利涉大川。",
378 ],
379 "explain_detail": ""
380 },
381 "011110": {
382 "name": "大过【卦二十八】泽风大过",
383 "come_from": "兑上巽下",
384 "indicate":[
385 "《大过》:栋挠,利有攸往,亨。",
386 "初六,藉用白茅,无咎。",
387 "九二,枯杨生稊,老夫得其女妻,无不利。",
388 "九三,栋桡,凶。",
389 "九四,栋隆,吉。有它,吝。",
390 "九五,枯杨生华,老妇得其士夫,无咎无誉。",
391 "上六,过涉灭顶,凶。无咎。",
392 ],
393 "explain_detail": ""
394 },
395 "010010": {
396 "name": "习坎【卦二十九】坎为水",
397 "come_from": "坎上坎下",
398 "indicate":[
399 "《习坎》:有孚维心,亨。行有尚。",
400 "初六,习坎,入于坎,窞,凶。",
401 "九二,坎有险,求小得。",
402 "六三,来之坎,坎险且枕,入于坎,窞,勿用。",
403 "六四,樽酒簋贰用缶,纳约自牖,终无咎。",
404 "九五,坎不盈,祗既平,无咎。",
405 "上六,系用徽纆,窴于丛棘,三岁不得,凶。",
406 ],
407 "explain_detail": ""
408 },
409 "101101": {
410 "name": "离【卦三十】离为火",
411 "come_from": "离上离下",
412 "indicate":[
413 "《离》:利贞。亨。畜牝牛吉。",
414 "初九,履错然,敬之无咎。",
415 "六二,黄离,元吉。",
416 "九三,日昃之离,不鼓缶而歌,则大耋之嗟,凶。",
417 "九四,突如,其来如,焚如,死如,弃如。",
418 "六五,出涕沱若,戚嗟若,吉。",
419 "上九,王用出征,有嘉折首,获匪其丑,无咎。",
420 ],
421 "explain_detail": ""
422 },
423 "001110": {
424 "name": "咸【卦三十一】泽山咸",
425 "come_from": "兑上艮下",
426 "indicate":[
427 "《咸》:亨。利贞。取女吉。",
428 "初六,咸其拇。",
429 "六二,咸其腓,凶。居吉。",
430 "九三,咸其股,执其随,往吝。",
431 "九四,贞吉。悔亡。憧憧往来,朋从尔思。",
432 "九五,咸其脢,无悔。",
433 "上六,咸其辅颊舌。",
434 ],
435 "explain_detail": ""
436 },
437 "011100": {
438 "name": "恒【卦三十二】雷风恒",
439 "come_from": "震上巽下",
440 "indicate":[
441 "《恒》:亨。无咎。利贞。利有攸往。",
442 "初六,浚恒,贞凶,无攸利。",
443 "九二,悔亡。",
444 "九三,不恒其德,或承之羞,贞吝。",
445 "九四,田无禽。",
446 "六五,恒其德,贞,妇人吉,夫子凶。",
447 "上六,振恒,凶。",
448 ],
449 "explain_detail": ""
450 },
451 "001111": {
452 "name": "遯【卦三十三】天山遯",
453 "come_from": "乾上艮下",
454 "indicate":[
455 "《遯》:亨。小利贞。",
456 "初六,遯尾,厉,勿用有攸往。",
457 "六二,执之用黄牛之革,莫之胜说。",
458 "九三,系遯,有疾厉,畜臣妾吉。",
459 "九四,好遯,君子吉,小人否。",
460 "九五,嘉遯,贞吉。",
461 "上九,肥遯,无不利。",
462 ],
463 "explain_detail": ""
464 },
465 "111100": {
466 "name": "大壮【卦三十四】雷天大壮",
467 "come_from": "震上乾下",
468 "indicate":[
469 "《大壮》:利贞。",
470 "初九,壮于趾,征凶,有孚。",
471 "九二,贞吉。",
472 "九三,小人用壮,君子用罔,贞厉。羝羊触藩,羸其角。",
473 "九四,贞吉,悔亡。藩决不羸,壮于大舆之輹。",
474 "六五,丧羊于易,无悔。",
475 "上六,羝羊触藩,不能退,不能遂,无攸利,艰则吉。",
476 ],
477 "explain_detail": ""
478 },
479 "000101": {
480 "name": "晋【卦三十五】火地晋",
481 "come_from": "离上坤下",
482 "indicate":[
483 "《晋》:康侯用锡马蕃庶,昼日三接。",
484 "初六,晋如摧如,贞吉。罔孚,裕无咎。",
485 "六二,晋如,愁如,贞吉。受兹介福于,其王母。",
486 "六三,众允,悔亡。",
487 "九四,晋如鼫鼠,贞厉。",
488 "六五,悔亡,失得,勿恤。往吉,无不利。",
489 "上九,晋其角,维用伐邑,厉吉,无咎,贞吝。",
490 ],
491 "explain_detail": ""
492 },
493 "101000": {
494 "name": "明夷【卦三十六】地火明夷",
495 "come_from": "坤上离下",
496 "indicate":[
497 "《明夷》:利艰贞。",
498 "初九:“明夷于飞,垂其翼。君子于行,三日不食。”有攸往, 主人有言。",
499 "六二:明夷,夷于左股,用拯马壮。吉。",
500 "九三:明夷于南狩,得其大首。不可疾贞。",
501 "六四:入于左腹,获明夷之心,于出门庭。",
502 "六五:箕子之明夷,利贞。",
503 "上六:不明,晦。初登于天,后入于地。",
504 ],
505 "explain_detail": ""
506 },
507 "101011": {
508 "name": "家人【卦三十七】风火家人",
509 "come_from": "巽上离下",
510 "indicate":[
511 "《家人》:利女贞。",
512 "初九,闲有家,悔亡。",
513 "六二,无攸遂,在中馈,贞吉。",
514 "九三,家人嗃□,悔厉吉;妇子嘻嘻,终吝。",
515 "六四,富家,大吉。",
516 "九五,王假有家,勿恤,吉。",
517 "上九,有孚威如,终吉。",
518 ],
519 "explain_detail": ""
520 },
521 "110101": {
522 "name": "睽【卦三十八】火泽睽",
523 "come_from": "离上兑下",
524 "indicate":[
525 "《睽》:小事吉。",
526 "初九,悔亡。丧马勿逐自复。见恶人无咎。",
527 "九二,遇主于巷,无咎。",
528 "六三,见舆曳,其牛掣,其人天且劓,无初有终。",
529 "九四,睽孤遇元夫,交孚,厉,无咎。",
530 "六五,悔亡。厥宗噬肤,往何咎?",
531 "上九,睽孤,见豕负涂,载鬼一车,先张之弧,后说之弧,匪寇婚媾。往遇雨则吉。",
532 ],
533 "explain_detail": ""
534 },
535 "001010": {
536 "name": "蹇【卦三十九】水山蹇",
537 "come_from": "坎上艮下",
538 "indicate":[
539 "《蹇》:利西南,不利东北。利见大人。贞吉。",
540 "初六,往蹇来誉。",
541 "六二,王臣蹇蹇,匪躬之故。",
542 "九三,往蹇来反。",
543 "六四,往蹇来连。",
544 "九五,大蹇朋来。",
545 "上六,往蹇来硕,吉,利见大人。",
546 ],
547 "explain_detail": ""
548 },
549 "010100": {
550 "name": "解【卦四十】雷水解",
551 "come_from": "震上坎下",
552 "indicate":[
553 "《解》:利西南。无所往,其来复吉。有攸往,夙吉。",
554 "初六,无咎。",
555 "九二,田获三狐,得黄矢,贞吉。",
556 "六三,负且乘,致寇至,贞吝。",
557 "九四,解而拇,朋至斯孚。",
558 "六五,君子维有解,吉,有孚于小人。",
559 "上六,公用射隼于高墉之上,获之,无不利。",
560 ],
561 "explain_detail": ""
562 },
563 "110001": {
564 "name": "损【卦四十一】山泽损",
565 "come_from": "艮上兑下",
566 "indicate":[
567 "《损》:有孚,元吉,无咎。可贞,利有攸往。曷之用?二簋可用享。",
568 "初九,已事遄往,无咎。酌损之。",
569 "九二,利贞。征凶,弗损,益之。",
570 "六三,三人行则损一人,一人行则得其友。",
571 "六四,损其疾,使遄有喜,无咎。",
572 "六五,或益之十朋之龟,弗克违,元吉。",
573 "上九,弗损,益之,无咎,贞吉,利有攸往,得臣无家。",
574 ],
575 "explain_detail": ""
576 },
577 "100011": {
578 "name": "益【卦四十二】风雷益",
579 "come_from": "巽上震下",
580 "indicate":[
581 "《益》:利有攸往。利涉大川。",
582 "初九,利用为大作,元吉,无咎。",
583 "六二,或益之十朋之龟,弗克违。永贞吉。王用享于帝,吉。",
584 "六三,益之用凶事,无咎。有孚。中行告公用圭。",
585 "六四,中行告公,从,利用为依迁国。",
586 "九五,有孚惠心,勿问,元吉。有孚,惠我德。",
587 "上九,莫益之,或击之,立心勿恒,凶。",
588 ],
589 "explain_detail": ""
590 },
591 "111110": {
592 "name": "夬【卦四十三】泽天夬",
593 "come_from": "兑上乾下",
594 "indicate":[
595 "《夬》:扬于王庭,孚号。有厉,告自邑。不利即戎,利有攸往。",
596 "初九,壮于前趾,往不胜,为咎。",
597 "九二,惕号,莫夜有戎,勿恤。",
598 "九三,壮于頄,有凶。君子夬夬独行,遇雨若濡,有愠无咎。",
599 "九四,臀无肤,其行次且。牵羊悔亡,闻言不信。",
600 "九五,苋陆夬夬中行,无咎。",
601 "上六,无号,终有凶。",
602 ],
603 "explain_detail": ""
604 },
605 "011111": {
606 "name": "姤【卦四十四】天风姤",
607 "come_from": "乾上巽下",
608 "indicate":[
609 "《姤》:女壮,勿用取女。",
610 "初六,系于金柅,贞吉。有攸往,见凶,羸豕孚蹢躅。",
611 "九二,包有鱼,无咎,不利宾。",
612 "九三,臀无肤,其行次且,厉,无大咎。",
613 "九四,包无鱼,起凶。",
614 "九五,以杞包瓜,含章,有陨自天。",
615 "上九,姤其角,吝,无咎。",
616 ],
617 "explain_detail": ""
618 },
619 "000110": {
620 "name": "萃【卦四十五】泽地萃",
621 "come_from": "兑上坤下",
622 "indicate":[
623 "《萃》:亨,王假有庙。利见大人。亨,利贞,用大牲吉。利有攸往。",
624 "初六,有孚不终,乃乱乃萃,若号,一握为笑,勿恤,往无咎。",
625 "六二,引吉,无咎,孚乃利用禴。",
626 "六三,萃如嗟如,无攸利,往无咎,小吝。",
627 "九四,大吉无咎。",
628 "九五,萃有位,无咎。匪孚,元永贞,悔亡。",
629 "上六,赍咨涕洟,无咎。",
630 ],
631 "explain_detail": ""
632 },
633 "011000": {
634 "name": "升【卦四十六】地风升",
635 "come_from": "坤上巽下",
636 "indicate":[
637 "《升》:元亨。用见大人,勿恤。南征吉。",
638 "初六,允升,大吉。",
639 "九二,孚乃利用禴,无咎。",
640 "九三,升虚邑。",
641 "六四,王用亨于岐山,吉,无咎。",
642 "六五,贞吉,升阶。",
643 "上六,冥升,利于不息之贞。",
644 ],
645 "explain_detail": ""
646 },
647 "010110": {
648 "name": "困【卦四十七】泽水困",
649 "come_from": "兑上坎下",
650 "indicate":[
651 "《困》:亨。贞大人吉,无咎。有言不信。",
652 "初六,臀困于株木,入于幽谷,三岁不觌。",
653 "九二,困于酒食,朱绂方来。利用享祀。征凶,无咎。",
654 "六三,困于石,据于蒺藜,入于其宫,不见其妻,凶。",
655 "九四,来徐徐,困于金车,吝,有终。",
656 "九五,劓刖,困于赤绂,乃徐有说,利用祭祀。",
657 "上六,困于葛藟,于臲<臬兀>,曰动悔有悔,征吉。",
658 ],
659 "explain_detail": ""
660 },
661 "011010": {
662 "name": "井【卦四十八】水风井",
663 "come_from": "坎上巽下",
664 "indicate":[
665 "《井》:改邑不改井,无丧无得。往来井井。汔至,亦未繘井,羸其瓶,凶。",
666 "初六,井泥不食。旧井无禽。",
667 "九二,井谷射鲋,瓮敝漏。",
668 "九三,井渫不食,为我心恻。可用汲,王明并受其福。",
669 "六四,井甃,无咎。",
670 "九五,井洌,寒泉食。",
671 "上六,井收勿幕,有孚元吉。",
672 ],
673 "explain_detail": ""
674 },
675 "101110": {
676 "name": "革【卦四十九】泽火革",
677 "come_from": "兑上离下",
678 "indicate":[
679 "《革》:已日乃孚。元亨。利贞,悔亡。",
680 "初九,巩用黄牛之革。",
681 "六二,巳日乃革之,征吉,无咎。",
682 "九三,征凶。贞厉。革言三就,有孚。",
683 "九四,悔亡。有孚改命,吉。",
684 "九五,大人虎变,未占有孚。",
685 "上六,君子豹变,小人革面,征凶,居贞吉。",
686 ],
687 "explain_detail": ""
688 },
689 "011101": {
690 "name": "鼎【卦五十】火风鼎",
691 "come_from": "离上巽下",
692 "indicate":[
693 "《鼎》:元吉,亨。",
694 "初六:鼎颠趾,利出否,得妾以其子,无咎。",
695 "九二:鼎有实,我仇有疾,不我能即,吉。",
696 "九三:鼎耳革,其行塞,雉膏不食,方雨亏悔,终吉。",
697 "九四:鼎折足,覆公餗,其形渥,凶。",
698 "六五:鼎黄耳金铉,利贞。",
699 "上九:鼎玉铉,大吉,无不利。",
700 ],
701 "explain_detail": ""
702 },
703 "100100": {
704 "name": "震【卦五十一】震为雷",
705 "come_from": "震上震下",
706 "indicate":[
707 "《震》:亨。震来虩虩,笑言哑哑,震惊百里,不丧匕鬯。",
708 "初九,震来虩虩,后笑言哑哑,吉。",
709 "六二,震来厉,亿丧贝,跻于九陵,勿逐,七日得。",
710 "六三,震苏苏,震行无眚。",
711 "九四,震遂泥。",
712 "六五,震往来,厉,意无丧,有事。",
713 "上六,震索索,视矍矍,征凶。震不于其躬,于其邻,无咎。婚媾有言。",
714 ],
715 "explain_detail": ""
716 },
717 "001001": {
718 "name": "艮【卦五十二】艮为山",
719 "come_from": "艮上艮下",
720 "indicate":[
721 "《艮》:艮其背,不获其身,行其庭,不见其人,无咎。",
722 "初六,艮其趾,无咎。利永贞。",
723 "六二,艮其腓,不拯其随,其心不快。",
724 "九三,艮其限,列其夤,厉,熏心。",
725 "六四,艮其身,无咎。",
726 "六五,艮其辅,言有序,悔亡。",
727 "上九,敦艮,吉。",
728 ],
729 "explain_detail": ""
730 },
731 "001011": {
732 "name": "渐【卦五十三】风山渐",
733 "come_from": "巽上艮下",
734 "indicate":[
735 "《渐》:女归吉,利贞。",
736 "初六,鸿渐于干。小子厉,有言,无咎。",
737 "六二,鸿渐于磐,饮食衎衎,吉。",
738 "九三,鸿渐于陆。夫征不复,妇孕不育,凶。利御寇。",
739 "六四,鸿渐于木,或得其桷,无咎。",
740 "九五,鸿渐于陵,妇三岁不孕,终莫之胜,吉。",
741 "上九,鸿渐于陆,其羽可用为仪,吉。",
742 ],
743 "explain_detail": ""
744 },
745 "110100": {
746 "name": "归妹【卦五十四】雷泽归妹",
747 "come_from": "震上兑下",
748 "indicate":[
749 "《归妹》:征凶,无攸利。",
750 "初九,归妹以娣。跛能履,征吉。",
751 "九二,眇能视,利幽人之贞。",
752 "六三,归妹以须,反归以娣。",
753 "九四,归妹愆期,迟归有时。",
754 "六五,帝乙归妹,其君之袂不如其娣之袂良。月几望,吉。",
755 "上六,女承筐无实,士刲羊无血,无攸利。",
756 ],
757 "explain_detail": ""
758 },
759 "101100": {
760 "name": "丰【卦五十五】雷火丰",
761 "come_from": "震上离下",
762 "indicate":[
763 "《丰》:亨,王假之。勿忧,宜日中。",
764 "初九,遇其配主,虽旬无咎,往有尚。",
765 "六二,丰其蔀,日中见斗。往得疑疾,有孚发若,吉。",
766 "九三,丰其沛,日中见沫,折其右肱,无咎。",
767 "九四,丰其蔀,日中见斗,遇其夷主,吉。",
768 "六五,来章有庆誉,吉。",
769 "上六,丰其屋,蔀其家,窥其户,阒其无人,三岁不觌,凶。",
770 ],
771 "explain_detail": ""
772 },
773 "001101": {
774 "name": "旅【卦五十六】火山旅",
775 "come_from": "离上艮下",
776 "indicate":[
777 "《旅》:小亨。旅贞吉。",
778 "初六,旅琐琐,斯其所取灾。",
779 "六二,旅即次,怀其资,得童仆,贞。",
780 "九三,旅焚其次,丧其童仆,贞厉。",
781 "九四,旅于处,得其资斧,我心不快。",
782 "六五,射雉,一矢亡,终以誉命。",
783 "上九,鸟焚其巢,旅人先笑后号啕。丧牛于易,凶。",
784 ],
785 "explain_detail": ""
786 },
787 "011011": {
788 "name": "巽【卦五十七】巽为风",
789 "come_from": "巽上巽下",
790 "indicate":[
791 "《巽》:小亨。利有攸往。利见大人。",
792 "初六,进退,利武人之贞。",
793 "九二,巽在床下,用史巫纷若,吉,无咎。",
794 "九三,频巽,吝。",
795 "六四,悔亡,田获三品。",
796 "九五,贞吉,悔亡,无不利,无初有终。先庚三日,后庚三日,吉。",
797 "上九,巽在床下,丧其资斧,贞凶。",
798 ],
799 "explain_detail": ""
800 },
801 "110110": {
802 "name": "兑【卦五十八】兑为泽",
803 "come_from": "兑上兑下",
804 "indicate":[
805 "《兑》:亨。利贞。",
806 "初九,和兑,吉。",
807 "九二,孚兑,吉,悔亡。",
808 "六三,来兑,凶。",
809 "九四,商兑未宁,介疾有喜。",
810 "九五,孚于剥,有厉。",
811 "上六,引兑。",
812 ],
813 "explain_detail": ""
814 },
815 "010011": {
816 "name": "涣【卦五十九】风水涣",
817 "come_from": "巽上坎下",
818 "indicate":[
819 "《涣》:亨。王假有庙。利涉大川,利贞。",
820 "初六,用拯马壮,吉。",
821 "九二,涣奔其机,悔亡。",
822 "六三,涣其躬,无悔。",
823 "六四,涣其群,元吉。涣有丘,匪夷所思。",
824 "九五,涣汗其大号,涣王居,无咎。",
825 "上九,涣其血,去逖出,无咎。",
826 ],
827 "explain_detail": ""
828 },
829 "110010": {
830 "name": "节【卦六十】水泽节",
831 "come_from": "坎上兑下",
832 "indicate":[
833 "《节》:亨。苦节,不可贞。",
834 "初九,不出户庭,无咎。",
835 "九二,不出门庭,凶。",
836 "六三,不节若,则嗟若,无咎。",
837 "六四,安节。亨。",
838 "九五,甘节,吉,往有尚。",
839 "上六,苦节,贞凶,悔亡。",
840 ],
841 "explain_detail": ""
842 },
843 "110011": {
844 "name": "中孚【卦六十一】风泽中孚",
845 "come_from": "巽上兑下",
846 "indicate":[
847 "《中孚》:豚鱼,吉。利涉大川,利贞。",
848 "初九,虞吉,有它不燕。",
849 "九二,鸣鹤在阴,其子和之。我有好爵,吾与尔靡之。",
850 "六三,得敌,或鼓或罢,或泣或歌。",
851 "六四,月几望,马匹亡,无咎。",
852 "九五,有孚挛如,无咎。",
853 "上九,翰音登于天,贞凶。",
854 ],
855 "explain_detail": ""
856 },
857 "001100": {
858 "name": "小过【卦六十二】雷山小过",
859 "come_from": "震上艮下",
860 "indicate":[
861 "《小过》:亨。利贞。可小事,不可大事。飞鸟遗之音,不宜上,宜下,大吉。",
862 "初六,飞鸟以凶。",
863 "六二,过其祖,遇其妣。不及其君,遇其臣。无咎。",
864 "九三,弗过防之,从或戕之,凶。",
865 "九四,无咎。弗过遇之,往厉必戒,勿用永贞。",
866 "六五,密云不雨,自我西郊。公弋取彼在穴。",
867 "上六,弗遇过之,飞鸟离之,凶,是谓灾眚。",
868 ],
869 "explain_detail": ""
870 },
871 "101010": {
872 "name": "既济【卦六十三】水火既济",
873 "come_from": "坎上离下",
874 "indicate":[
875 "《既济》:亨小,利贞。初吉终乱。",
876 "初九,曳其轮,濡其尾,无咎。",
877 "六二,「妇丧其茀,勿逐,七日得。",
878 "九三,高宗伐鬼方,三年克之,小人勿用。",
879 "六四,繻有衣袽,终日戒。",
880 "九五,东邻杀牛,不如西邻之禴祭,实受其福。",
881 "上六,濡其首,厉。",
882 ],
883 "explain_detail": ""
884 },
885 "010101": {
886 "name": "未济【卦六十四】火水未济",
887 "come_from": "离上坎下",
888 "indicate":[
889 "《未济》:亨。小狐汔济,濡其尾,无攸利。",
890 "初六,濡其尾,吝。",
891 "九二,曳其轮,贞吉。",
892 "六三,未济,征凶。利涉大川。",
893 "九四,贞吉,悔亡,震用伐鬼方,三年,有赏于大国。",
894 "六五,贞吉,无悔。君子之光,有孚吉。",
895 "上九,有孚于饮酒,无咎。濡其首,有孚失是。",
896 ],
897 "explain_detail": ""
898 }
899 }