diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c245290 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.idea/ +*.pyc +*.swp +.DS_Store +/.localenv/ +/datasets/ +/.ipynb_checkpoints/ +core.* + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b09cd78 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..f496282 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# YI + 周易占卦解卦程序(纯娱乐)。 + + https:////www.cnblogs.com/lsdb/p/12444143.html diff --git a/_OVERVIEW.md b/_OVERVIEW.md new file mode 100644 index 0000000..d2a86d2 --- /dev/null +++ b/_OVERVIEW.md @@ -0,0 +1,5 @@ +## 介绍 (Introduction) + +添加该项目的功能、使用场景和输入输出参数等相关信息。 + +You can describe the function, usage and parameters of the project. \ No newline at end of file diff --git a/_README.ipynb b/_README.ipynb new file mode 100644 index 0000000..75867ff --- /dev/null +++ b/_README.ipynb @@ -0,0 +1,152 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1. 项目介绍\n", + "\n", + " - 项目是由模块组成、有特定功能的程序。它能够满足用户的直接使用需求,例如[古诗词生成器](https://momodel.cn/explore/5bfb634e1afd943c623dd9cf?type=app&tab=1)、[风格迁移](https://momodel.cn/explore/5bfb634e1afd943c623dd9cf?type=app&tab=1)等。\n", + " - 开发项目过程中你可以导入数据集,也可以通过每个 cell 上方工具栏的`<+>`直接插入[模块](https://momodel.cn/modules)和代码块。\n", + " - 你可以将开发好的项目进行[部署](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", + "\n", + " - 项目目录结构:\n", + "\n", + " - ```results```*-----结果的文件存放地(如果你运行 job,务必将运行结果指定在此目录)*\n", + " - ```_OVERVIEW.md``` *-----项目的相关介绍*\n", + " - ```_README.md```*-----说明文档*\n", + " - ```app_spec.yml```*-----定义项目的输入输出,为部署服务*\n", + " - ```coding_here.ipynb```*-----输入并运行代码*" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "## 2. 开发环境简介\n", + "\n", + "你当前所在的页面 Notebook 是一个内嵌 JupyterLab 的在线类 IDE 编程环境,开发过程中可以使用页面右侧的 API 文档进行快速查询。Notebook 有以下主要功能:\n", + "\n", + "- [调用数据集、模块和代码块资源](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", + "- [多人代码协作](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", + "- [在 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", + "- [简单部署](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", + "\n", + "快来动手试试吧!点击左侧工具栏的新建文件图标即可选择你需要的文件类型。\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "左侧和右侧工具栏都可根据使用需要进行收合。\n", + "" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 3. 快捷键与代码补全\n", + "Mo Notebook 已完全采用 Jupyter Notebook 的原生快捷键,并且支持 `tab` 代码补全。\n", + "\n", + "运行代码:`shift` + `enter` 或者 `shift` + `return`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 4. 常用指令介绍\n", + "\n", + "- 解压上传后的文件\n", + "\n", + "在 cell 中输入并运行以下命令:\n", + "```!7zx file_name.zip```\n", + "\n", + "- 查看所有包(package)\n", + "\n", + "`!pip list --format=columns`\n", + "\n", + "- 检查是否已有某个包\n", + "\n", + "`!pip show package_name`\n", + "\n", + "- 安装缺失的包\n", + "\n", + "`!pip install package_name`\n", + "\n", + "- 更新已有的包\n", + "\n", + "`!pip install package_name --upgrade`\n", + "\n", + "\n", + "- 使用包\n", + "\n", + "`import package_name`\n", + "\n", + "- 显示当前目录下的档案及目录\n", + "\n", + "`ls`\n", + "\n", + "- 使用引入的数据集\n", + "\n", + "数据集被引入后存放在 datasets 文件夹下,注意,这个文件夹是只读的,不可修改。如果需要修改,可在 Notebook 中使用\n", + "\n", + "`!cp -R ./datasets/ ./`\n", + "\n", + "指令将其复制到其他文件夹后再编辑,对于引入的数据集中的 zip 文件,可使用\n", + "\n", + "`!7zx ./datasets// ./`\n", + "\n", + "指令解压缩到其他文件夹后使用" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 5. 其他可参考资源\n", + "\n", + "- [帮助文档](https://momodel.cn/docs/#/):基本页面介绍和常见问题都可以在里面找到\n", + "- [平台功能教程](https://momodel.cn/classroom/class/5c5696cd1afd9458d456bf54):通过图文结合的 Notebook 详细介绍开发环境基本功能和操作\n", + "- [从 Python 到人工智能](https://momodel.cn/classroom/course/detail?&id=60f02c635076ff487bce4c6f):超易入门的 Python 课程\n", + "- [吴恩达机器学习](https://momodel.cn/classroom/class/5c5696191afd94720cc94533):机器学习经典课程\n", + "- [李宏毅机器学习](https://momodel.cn/classroom/class/5d63dde21afd9461419f5ebf):中文世界最好的机器学习课程\n", + "- [机器学习实战](https://momodel.cn/classroom/class/60af61b6f955c61c2cddfcb5):通过实操指引完成独立的模型,掌握相应的机器学习知识\n", + "- [深度学习实战](https://momodel.cn/classroom/class/5c680b311afd943a9f70901b):通过实操指引完成独立的模型,掌握相应的深度学习知识\n", + "- [模块开发](https://momodel.cn/modules):关于模型训练、开发与部署的高阶教程" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2" + }, + "pycharm": { + "stem_cell": { + "cell_type": "raw", + "source": [], + "metadata": { + "collapsed": false + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/coding_here.ipynb b/coding_here.ipynb new file mode 100644 index 0000000..90d9432 --- /dev/null +++ b/coding_here.ipynb @@ -0,0 +1,36 @@ + + { + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print('Hello Mo!')" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 + } + \ No newline at end of file diff --git a/results/README.md b/results/README.md new file mode 100644 index 0000000..81902f1 --- /dev/null +++ b/results/README.md @@ -0,0 +1,2 @@ +Please store your training checkpoints or results here +请在此处存储 checkpoints 和结果文件 \ No newline at end of file diff --git a/results/tb_results/README.md b/results/tb_results/README.md new file mode 100644 index 0000000..23659ee --- /dev/null +++ b/results/tb_results/README.md @@ -0,0 +1,2 @@ +Please store your tensorboard results here +请在此处存储 tensorboard 结果 diff --git a/yi.py b/yi.py new file mode 100644 index 0000000..d1ce124 --- /dev/null +++ b/yi.py @@ -0,0 +1,166 @@ +import random +import datetime +from yi_book import book + + +class YiProgram(): + def __init__(self): + pass + + # 设置随机数种子,确保用户输入一样时,得到的随机数是一样的 + def _set_random_seed(self, time_seed_str): + def _transfer_str_to_time_seed(): + user_input_str_bytes = time_seed_str.encode() + inner_random_seed = 0 + for tmp_byte in user_input_str_bytes: + inner_random_seed += tmp_byte + return inner_random_seed + random_seed = _transfer_str_to_time_seed() + random.seed(random_seed) + + # 执行一轮变化 + def _exec_one_transfer(self, cosmos_count): + # 第一步,将四十九颗棋子随机分为左右两组,象征混沌初开,天地一分为二,一边为天,一边为地。 + cosmos_list = [1] * cosmos_count + divide_index = random.randint(int(cosmos_count/3), int(cosmos_count/3)*2) + sky_list = cosmos_list[:divide_index] + land_list = cosmos_list[divide_index:] + # 第二步,有天有地就该有人,所以任意拿掉一组中的一个棋子,这颗棋子便为人。然后形成三才。 + person_point = random.randint(0,cosmos_count) + if person_point < divide_index: + sky_list.pop() + else: + land_list.pop() + # 第三步,以象征天的那组棋子数除以四,获得余数,如果整除则余数改为4(这里的四象征着一年四季)。 + sky_remainder = len(sky_list) % 4 + if sky_remainder == 0: + sky_remainder = 4 + # sky_list = sky_list[:-sky_remainder] + # 第四步,对象征地的那组进行同样的操作。 + land_remainder = len(land_list) % 4 + if land_remainder == 0: + land_remainder = 4 + # land_list = land_list[:-land_remainder] + # 第五步,减去象征人的棋子及两组的余数,获取剩余的棋子数 + remove_count = 1 + sky_remainder + land_remainder + cosmos_count = cosmos_count - remove_count + return cosmos_count + + # 递规执行三轮变化获取剩余的棋子数,即一爻 + def _gen_one_symbol(self, cosmos_count=49, transfer_index=0): + cosmos_count = self._exec_one_transfer(cosmos_count) + transfer_index += 1 + if transfer_index >= 3: + return cosmos_count + else: + return self._gen_one_symbol(cosmos_count=cosmos_count, transfer_index=transfer_index) + + # 获取六爻,组成本卦 + def _gen_origin_hexagram(self): + six_symbol_list = [] + for symbol_index in range(6): + tmp_symbol = int(self._gen_one_symbol() / 4) + six_symbol_list.append(tmp_symbol) + return six_symbol_list + + # 根据本卦获取变卦 + def _gen_support_hexagram(self, origin_hexagram): + support_hexagram = [] + for tmp_value in origin_hexagram: + if tmp_value == 6: + tmp_value = 9 + elif tmp_value == 9: + tmp_value = 6 + support_hexagram.append(tmp_value) + return support_hexagram + + # 分析变爻数及变爻下标列表 + def _get_turn_symbol_count_and_index_list(self, origin_hexagram, support_hexagram): + turn_symbol_count = 0 + turn_symbol_index_list = [] + not_turn_symbol_index_list = [] + for index in range(len(origin_hexagram)): + if origin_hexagram[index] != support_hexagram[index]: + turn_symbol_count += 1 + turn_symbol_index_list.append(index) + else: + not_turn_symbol_index_list.append(index) + return turn_symbol_count,turn_symbol_index_list,not_turn_symbol_index_list + + # 偶数为阴,奇数为阳 + def _get_hexagram_dict_key(self, hexagram): + hexagram_dict_key = "" + for tmp_value in hexagram: + hexagram_dict_key += str(tmp_value % 2) + return hexagram_dict_key + + # 解卦 + def _parser_hexagram(self, origin_hexagram, support_hexagram): + main_indicate = "" + support_indicate = "" + turn_symbol_desc = "" + origin_hexagram_dict_key = self._get_hexagram_dict_key(origin_hexagram) + support_hexagram_dict_key = self._get_hexagram_dict_key(support_hexagram) + turn_symbol_count,turn_symbol_index_list,not_turn_symbol_index_list = self._get_turn_symbol_count_and_index_list(origin_hexagram, support_hexagram) + # 六爻皆不变者,占本卦卦辞 + if turn_symbol_count == 0: + turn_symbol_desc = "六爻皆不变者,占本卦卦辞。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][0] + # 一爻变者,以本卦变爻之辞占 + elif turn_symbol_count == 1: + turn_symbol_desc = "一爻变者,以本卦变爻之辞占。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][turn_symbol_index_list[0]+1] + # 二爻变者,则以本卦二变爻之辞占,而以上爻之辞为主 + elif turn_symbol_count == 2: + turn_symbol_desc = "二爻变者,则以本卦二变爻之辞占,而以上爻之辞为主。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][turn_symbol_index_list[1]+1] + support_indicate = book[origin_hexagram_dict_key]["indicate"][turn_symbol_index_list[0]+1] + # 三爻变者,占本卦及之卦的卦辞,而以本卦为主 + elif turn_symbol_count == 3: + turn_symbol_desc = "三爻变者,占本卦及之卦的卦辞,而以本卦为主。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][0] + support_indicate = book[support_hexagram_dict_key]["indicate"][0] + # 四爻变者,以之卦中二不变之爻辞占,以下爻为主 + elif turn_symbol_count == 4: + turn_symbol_desc = "四爻变者,以之卦中二不变之爻辞占,以下爻为主。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][not_turn_symbol_index_list[0]+1] + support_indicate = book[origin_hexagram_dict_key]["indicate"][not_turn_symbol_index_list[1]+1] + # 五爻变者,以之卦中不变爻的爻辞占 + elif turn_symbol_count == 5: + turn_symbol_desc = "五爻变者,以之卦中不变爻的爻辞占。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][not_turn_symbol_index_list[0]+1] + # 六爻皆变者,以乾坤二用之辞占,并参考其之卦卦辞 + elif turn_symbol_count == 6: + turn_symbol_desc = "六爻皆变者,以乾坤二用之辞占,并参考其之卦卦辞。" + main_indicate = book[origin_hexagram_dict_key]["indicate"][7] + support_indicate = book[support_hexagram_dict_key]["indicate"][0] + return turn_symbol_desc,main_indicate,support_indicate + + def main_logic_new(self): + user_wish = input("请输入你所求之事:") + user_pray = input(f"请输入你的祈祷:") + today = datetime.datetime.now().__format__("%Y%m%d") + time_seed_str = user_wish + user_pray + today + # 设置随机数种子,确保当天同样的输出得到的结果是一样的 + self._set_random_seed(time_seed_str) + print("\n稍等,正在计算卦象...") + # 生成本卦 + origin_hexagram = self._gen_origin_hexagram() + # 计算变卦 + support_hexagram = self._gen_support_hexagram(origin_hexagram) + # 本卦对应的内容的key + origin_hexagram_dict_key = self._get_hexagram_dict_key(origin_hexagram) + # 变卦对应的内容的key + support_hexagram_dict_key = self._get_hexagram_dict_key(support_hexagram) + print(f"本卦:{origin_hexagram}--{book[origin_hexagram_dict_key]['name']}--{book[origin_hexagram_dict_key]['come_from']}\n" + f"变卦:{support_hexagram}--{book[support_hexagram_dict_key]['name']}--{book[support_hexagram_dict_key]['come_from']}") + print("\n稍等,正在解卦...") + # 解卦 + turn_symbol_desc, main_indicate, support_indicate = self._parser_hexagram(origin_hexagram, support_hexagram) + print(f"说明:{turn_symbol_desc}\n" + f"主预言:{main_indicate}\n" + f"辅预言:{support_indicate}") + +if __name__ == "__main__": + obj = YiProgram() + obj.main_logic_new() diff --git a/yi_book.py b/yi_book.py new file mode 100644 index 0000000..8b7559f --- /dev/null +++ b/yi_book.py @@ -0,0 +1,900 @@ +book = { + "111111": { + "name": "乾【卦一】乾为天", + "come_from": "乾上乾下", + "indicate":[ + "乾,元亨利贞。", + "初九:潜龙,勿用。", + "九二:见龙在田,利见大人。", + "九三:君子终日乾乾,夕惕若,厉,无咎。", + "九四:或跃在渊,无咎。", + "九五:飞龙在天,利见大人。", + "上九:亢龙,有悔。", + "用九:见群龙无首,吉。", + ], + "explain_detail": "" + }, + "000000": { + "name": "坤【卦二】坤为地", + "come_from": "坤下坤上", + "indicate":[ + "坤,元亨,利牝马之贞。君子有攸往,先迷后得主。利西南得朋,东北丧朋。安贞吉。", + "初六:履霜,坚冰至。", + "六二:直方,大,不习,无不利。", + "六三:含章可贞。或从王事,无成有终。", + "六四:括囊,无咎无誉。", + "六五:黄裳,元吉。", + "上六:龙战于野,其血玄黄。", + "用六:利永贞。", + ], + "explain_detail": "" + }, + "100010": { + "name": "屯【卦三】水雷屯", + "come_from": "震上坎下", + "indicate":[ + "屯,元亨,利贞。勿用有攸往,利建侯。", + "初九:磐桓。利居贞,利建侯。", + "六二:屯如邅如,乘马班如。匪寇婚媾。女子贞不字,十年乃字。", + "六三:即鹿无虞,惟入于林中。君子几,不如舍。往吝。", + "六四:乘马班如,求婚媾。往吉,无不利。", + "九五:屯其膏。小贞吉,大贞凶。", + "上六:乘马班如,泣血涟如。", + ], + "explain_detail": "" + }, + "010001": { + "name": "蒙【卦四】山水蒙", + "come_from": "坎下艮上", + "indicate":[ + "蒙,亨。匪我求童蒙,童蒙求我。初筮告,再三渎,渎则不告。利贞。", + "初六:发蒙。利用刑人,用说桎梏。以往吝。", + "九二:包蒙,吉。纳妇吉,子克家", + "六三:勿用取女,见金夫不有躬。无攸利", + "六四:困蒙,吝。", + "六五:童蒙,吉。", + "上九:击蒙。不利为寇,利御寇。", + ], + "explain_detail": "" + }, + "111010": { + "name": "需【卦五】水天需", + "come_from": "乾下坎上", + "indicate":[ + "需,有孚,光亨,贞吉。利涉大川。", + "初九:需于郊,利用恒,无咎。", + "九二:需于沙,小有言,终吉。", + "九三:需于泥,致寇至。", + "六四:需于血,出自穴。", + "九五:需于酒食,贞吉。", + "上六:入于穴,有不带之客三人来,敬之终吉。", + ], + "explain_detail": "" + }, + "010111": { + "name": "讼【卦六】天水讼", + "come_from": "坎下乾上", + "indicate":[ + "讼,有孚窒惕,中吉,终凶。利见大人,不利涉大川。", + "初六:不永所事,小有言,终吉。", + "九二:不克讼,归而逋。其邑人三百户,元眚。", + "六三:依旧德,贞厉,终吉。或从王事,无成。", + "九四:不克讼,复即命,渝安贞,吉。", + "九五:讼,元吉。", + "上九:或锡之鞶带,终朝三褫之。", + ], + "explain_detail": "" + }, + "010000": { + "name": "师【卦七】地水师", + "come_from": "坎下坤上", + "indicate":[ + "师,贞,丈人吉。无咎。", + "初六:师出以律,否藏凶。", + "九二:在师中,吉,无咎。王三锡命。", + "六三:师或舆尸,凶。", + "六四:师左次,无咎。", + "六五:田有禽,利执言,无咎。长子帅师,第子舆尸。贞凶。", + "上六:大君有命,开国承家,小人勿用。", + ], + "explain_detail": "" + }, + "000010": { + "name": "比【卦八】水地比", + "come_from": "坤下坎上", + "indicate":[ + "比,吉。原筮,元永贞,无咎。不宁方来,后夫凶。", + "初六:有孚,比之,无咎。有孚盈缶,终来有它,吉。", + "六二:比之有内,贞吉。", + "六三:比之匪人。", + "六四:外比之,贞吉。", + "九五:显比。王用三驱失前禽。邑人不诫,吉。", + "上六:比之无首,凶。", + ], + "explain_detail": "" + }, + "111011": { + "name": "小畜【卦九】风天小畜", + "come_from": "乾下巽上", + "indicate":[ + "小畜,亨。密云水雨,自我西郊。", + "初九:复自道,何其咎?吉。", + "九二:牵复,吉。", + "九三:舆说fu,夫妻反目。", + "六四:有孚,血云惕出,无咎。", + "九五:有孚挛如,富以其邻。", + "上九:既雨既处,尚德载,妇贞厉,月几望,君子征凶。", + ], + "explain_detail": "" + }, + "110111": { + "name": "履【卦十】天泽履", + "come_from": "兑下乾上", + "indicate":[ + "履:履虎尾,不咥人。亨。", + "初九:素履往,无咎。", + "九二:履道坦坦,幽人贞吉。", + "六三:眇能视,跛能履。履虎尾,咥人,凶。武人为于大君。", + "九四:履虎尾,愬愬终吉。", + "九五:夬履,贞厉。", + "上九:视履考详,其旋元吉。", + ], + "explain_detail": "" + }, + "111000": { + "name": "泰【卦十五】地天泰", + "come_from": "乾下坤上", + "indicate":[ + "泰,小往大来,吉,亨。", + "初九:拔茅茹,以其汇,征吉。", + "九二:包荒,用冯河,不遐遗,朋亡。复尚于中行。", + "九三:无平不陂,无往不复。艰贞无咎。勿恤其孚,于食有福。", + "六四:翩翩,不富以其邻,不戒以孚。", + "六五:帝乙归妹,以祉,元吉。", + "上六:城复于隍,勿用师,自邑告命。贞吝。", + ], + "explain_detail": "" + }, + "000111": { + "name": "否【卦十二】天地否", + "come_from": "坤下乾上", + "indicate":[ + "否,否之匪人,不利君子贞。大往小来。", + "初六:拔茅茹,以其汇。贞吉亨。", + "六二:包承。小人吉,大人否亨。", + "六三:包羞。", + "九四:有命无咎,畴离祉。", + "九五:休否,大人吉。其亡其亡,系于苞桑。", + "上九:倾否,先否后喜。", + ], + "explain_detail": "" + }, + "101111": { + "name": "同人【卦十三】天火同人", + "come_from": "离下乾上", + "indicate":[ + "同人,同人于野,亨,利涉大川。利君子贞。", + "初九:同人于门,无咎。", + "六二:同人于宗,吝。", + "九三:伏戎于莽。升其高陵,三岁不兴。", + "九四:乘其墉,弗克攻,吉。", + "九五:同人先号啕而后笑。大师克相遇。", + "上九:同人于郊,无悔。", + ], + "explain_detail": "" + }, + "111101": { + "name": "大有【卦十四】火天大有", + "come_from": "乾下离上", + "indicate":[ + "大有,元亨。", + "初九:无交害,匪咎。艰则无咎。", + "九二:大车以载,有攸往,无咎。", + "九三:公用亨于天子,小人弗克。", + "九四:匪其尪,无咎。", + "六五:厥孚交如,威如,吉。", + "上九:自天佑之。吉,无不利。", + ], + "explain_detail": "" + }, + "001000": { + "name": "谦【卦十五】地山谦", + "come_from": "艮下坤上", + "indicate":[ + "谦,亨,君子有终。", + "初六:谦谦君子,用涉大川,吉。", + "六二:鸣谦,贞吉。", + "九三:劳谦,君子有终,吉。", + "六四:无不利,hui谦。", + "六五:不富以其邻。利用侵代,无不利。", + "上六:鸣谦。利用行师,征邑国。", + ], + "explain_detail": "" + }, + "000100": { + "name": "豫【卦十六】雷地豫", + "come_from": "坤下震上", + "indicate":[ + "豫,利建侯行师。", + "初六:鸣豫,凶。", + "六二:介于石。不终日,贞吉。", + "六三:盱豫悔,迟有悔。", + "九四:由豫,大有得。勿疑,朋盍簪。", + "六五:贞疾,恒不死。", + "上六:冥豫,成有渝,无咎。", + ], + "explain_detail": "" + }, + "100110": { + "name": "随【卦十七】泽雷随", + "come_from": "震下兑上", + "indicate":[ + "随,元亨,利贞。无咎。", + "初九:官有渝,贞吉。出门交有功。", + "六二:系小子,失丈夫。", + "六三:系丈夫,失小子。随有求得。利居贞。", + "九四:随有获,贞凶。有孚在道,以明,何咎?", + "九五:孚于嘉,吉。", + "上六:拘系之,乃从维之。王用亨于西山。", + ], + "explain_detail": "" + }, + "011001": { + "name": "蛊【卦十八】山风蛊", + "come_from": "巽下艮上", + "indicate":[ + "蛊,元亨,利涉大川。先甲三日,后甲三日。", + "初六:干父之蛊,有子,考无咎,厉终吉。", + "九二:干母之蛊,不可贞。", + "九三:干父之蛊,小有悔,无大咎。", + "六四:裕父之蛊,往见吝。", + "六五:干父之蛊,用誉。", + "上九:不事王侯,高尚其事。", + ], + "explain_detail": "" + }, + "110000": { + "name": "临【卦十九】地泽临", + "come_from": "兑下坤上", + "indicate":[ + "临,元亨,利贞,至于八月有凶。", + "初九:咸临,贞吉。", + "九二:咸临,吉,无不利。", + "六三:甘临,无攸利。既忧之,无咎。", + "六四:至临,无咎。", + "六五:知临,大君之宜,吉。", + "上六:敦临,吉,无咎。", + ], + "explain_detail": "" + }, + "000011": { + "name": "观【卦二十】风地观", + "come_from": "坤下巽上", + "indicate":[ + "观,盥而不荐。有孚颙若。", + "初六:童观,小人无咎,君子吝。", + "六二:窥观,利女贞。", + "六三:观我生。进退。", + "六四:观国之光。利用宾于王。", + "九五:观我生,君子无咎。", + "上九:观其生,君子无咎。", + ], + "explain_detail": "" + }, + "100101": { + "name": "噬嗑[卦二十一]火雷噬嗑", + "come_from": "离上震下", + "indicate":[ + "《噬嗑》:亨。利用狱。", + "初九,屦校灭趾,无咎。", + "六二,噬肤灭鼻,无咎。", + "六三,噬腊肉遇毒,小吝,无咎。", + "九四,「噬干胏,得金矢。利艰贞,吉。", + "六五,噬乾肉得黄金。贞厉,无咎。", + "上九,何校灭耳,凶。", + ], + "explain_detail": "" + }, + "101001": { + "name": "贲【卦二十二】山火贲", + "come_from": "艮上离下", + "indicate":[ + "《贲》:亨。小利有攸往。", + "初九,贲其趾,舍车而徒。", + "六二,贲其须。", + "九三,贲如,濡如,永贞吉。", + "六四,贲如皤如,白马翰如。匪寇,婚媾。", + "六五,贲于丘园,束帛戋戋,吝,终吉。", + "上九,白贲,无咎。", + ], + "explain_detail": "" + }, + "000001": { + "name": "剥[卦二十三】山地剥", + "come_from": "艮上坤下", + "indicate":[ + "《剥》:不利有攸往。", + "初六:剥床以足,蔑贞凶。", + "六二:剥床以辨,蔑贞凶。", + "六三:剥之,无咎。", + "六四:剥床以肤,凶。", + "六五:贯鱼以宫人宠,无不利。", + "上九:硕果不食,君子得舆,小人剥庐。", + ], + "explain_detail": "" + }, + "100000": { + "name": "复【卦二十四】地雷复", + "come_from": "坤上震下", + "indicate":[ + "《复》:亨。出入无疾。朋来无咎。反覆其道,七日来复,利有攸往。", + "初九,不远复,无祗悔,元吉。", + "六二,休复,吉。", + "六三,频复,厉,无咎。", + "六四,中行独复。", + "六五,敦复,无悔。", + "上六,迷复,凶,有灾眚。用行师,终有大败,以其国君凶,至于十年不克征。", + ], + "explain_detail": "" + }, + "100111": { + "name": "无妄【卦二十五】天雷无妄", + "come_from": "乾上震下", + "indicate":[ + "《无妄》:元亨,利贞。其匪正有眚,不利有攸往。", + "初九,无妄往,吉。", + "六二,不耕获,不菑畲,则利用攸往。", + "六三,无妄之灾,或系之牛,行人之得,邑人之灾。", + "九四,可贞。无咎。", + "九五,无妄之疾,勿药有喜。", + "上九,无妄行,有眚,无攸利。", + ], + "explain_detail": "" + }, + "111001": { + "name": "大畜【卦二十六】山天大畜", + "come_from": "艮上乾下", + "indicate":[ + "《大畜》:利贞。不家食吉。利涉大川。", + "初九,有厉,利已。", + "九二,舆说輹", + "九三,良马逐,利艰贞,曰闲舆卫,利有攸往。", + "六四,童牛之牿,元吉。", + "六五,豶豕之牙,吉。", + "上九,何天之衢,亨。", + ], + "explain_detail": "" + }, + "100001": { + "name": "颐【卦二十七】山雷颐", + "come_from": "艮上震下", + "indicate":[ + "《颐》:贞吉。观颐,自求口实。", + "初九,舍尔灵龟,观我朵颐,凶。", + "六二,颠颐拂经于丘颐,征凶。", + "六三,拂颐,贞凶,十年勿用,无攸利。", + "六四,颠颐,吉。虎视眈眈,其欲逐逐,无咎。", + "六五,拂经,居贞吉,不可涉大川。", + "上九,由颐,厉,吉。利涉大川。", + ], + "explain_detail": "" + }, + "011110": { + "name": "大过【卦二十八】泽风大过", + "come_from": "兑上巽下", + "indicate":[ + "《大过》:栋挠,利有攸往,亨。", + "初六,藉用白茅,无咎。", + "九二,枯杨生稊,老夫得其女妻,无不利。", + "九三,栋桡,凶。", + "九四,栋隆,吉。有它,吝。", + "九五,枯杨生华,老妇得其士夫,无咎无誉。", + "上六,过涉灭顶,凶。无咎。", + ], + "explain_detail": "" + }, + "010010": { + "name": "习坎【卦二十九】坎为水", + "come_from": "坎上坎下", + "indicate":[ + "《习坎》:有孚维心,亨。行有尚。", + "初六,习坎,入于坎,窞,凶。", + "九二,坎有险,求小得。", + "六三,来之坎,坎险且枕,入于坎,窞,勿用。", + "六四,樽酒簋贰用缶,纳约自牖,终无咎。", + "九五,坎不盈,祗既平,无咎。", + "上六,系用徽纆,窴于丛棘,三岁不得,凶。", + ], + "explain_detail": "" + }, + "101101": { + "name": "离【卦三十】离为火", + "come_from": "离上离下", + "indicate":[ + "《离》:利贞。亨。畜牝牛吉。", + "初九,履错然,敬之无咎。", + "六二,黄离,元吉。", + "九三,日昃之离,不鼓缶而歌,则大耋之嗟,凶。", + "九四,突如,其来如,焚如,死如,弃如。", + "六五,出涕沱若,戚嗟若,吉。", + "上九,王用出征,有嘉折首,获匪其丑,无咎。", + ], + "explain_detail": "" + }, + "001110": { + "name": "咸【卦三十一】泽山咸", + "come_from": "兑上艮下", + "indicate":[ + "《咸》:亨。利贞。取女吉。", + "初六,咸其拇。", + "六二,咸其腓,凶。居吉。", + "九三,咸其股,执其随,往吝。", + "九四,贞吉。悔亡。憧憧往来,朋从尔思。", + "九五,咸其脢,无悔。", + "上六,咸其辅颊舌。", + ], + "explain_detail": "" + }, + "011100": { + "name": "恒【卦三十二】雷风恒", + "come_from": "震上巽下", + "indicate":[ + "《恒》:亨。无咎。利贞。利有攸往。", + "初六,浚恒,贞凶,无攸利。", + "九二,悔亡。", + "九三,不恒其德,或承之羞,贞吝。", + "九四,田无禽。", + "六五,恒其德,贞,妇人吉,夫子凶。", + "上六,振恒,凶。", + ], + "explain_detail": "" + }, + "001111": { + "name": "遯【卦三十三】天山遯", + "come_from": "乾上艮下", + "indicate":[ + "《遯》:亨。小利贞。", + "初六,遯尾,厉,勿用有攸往。", + "六二,执之用黄牛之革,莫之胜说。", + "九三,系遯,有疾厉,畜臣妾吉。", + "九四,好遯,君子吉,小人否。", + "九五,嘉遯,贞吉。", + "上九,肥遯,无不利。", + ], + "explain_detail": "" + }, + "111100": { + "name": "大壮【卦三十四】雷天大壮", + "come_from": "震上乾下", + "indicate":[ + "《大壮》:利贞。", + "初九,壮于趾,征凶,有孚。", + "九二,贞吉。", + "九三,小人用壮,君子用罔,贞厉。羝羊触藩,羸其角。", + "九四,贞吉,悔亡。藩决不羸,壮于大舆之輹。", + "六五,丧羊于易,无悔。", + "上六,羝羊触藩,不能退,不能遂,无攸利,艰则吉。", + ], + "explain_detail": "" + }, + "000101": { + "name": "晋【卦三十五】火地晋", + "come_from": "离上坤下", + "indicate":[ + "《晋》:康侯用锡马蕃庶,昼日三接。", + "初六,晋如摧如,贞吉。罔孚,裕无咎。", + "六二,晋如,愁如,贞吉。受兹介福于,其王母。", + "六三,众允,悔亡。", + "九四,晋如鼫鼠,贞厉。", + "六五,悔亡,失得,勿恤。往吉,无不利。", + "上九,晋其角,维用伐邑,厉吉,无咎,贞吝。", + ], + "explain_detail": "" + }, + "101000": { + "name": "明夷【卦三十六】地火明夷", + "come_from": "坤上离下", + "indicate":[ + "《明夷》:利艰贞。", + "初九:“明夷于飞,垂其翼。君子于行,三日不食。”有攸往, 主人有言。", + "六二:明夷,夷于左股,用拯马壮。吉。", + "九三:明夷于南狩,得其大首。不可疾贞。", + "六四:入于左腹,获明夷之心,于出门庭。", + "六五:箕子之明夷,利贞。", + "上六:不明,晦。初登于天,后入于地。", + ], + "explain_detail": "" + }, + "101011": { + "name": "家人【卦三十七】风火家人", + "come_from": "巽上离下", + "indicate":[ + "《家人》:利女贞。", + "初九,闲有家,悔亡。", + "六二,无攸遂,在中馈,贞吉。", + "九三,家人嗃□,悔厉吉;妇子嘻嘻,终吝。", + "六四,富家,大吉。", + "九五,王假有家,勿恤,吉。", + "上九,有孚威如,终吉。", + ], + "explain_detail": "" + }, + "110101": { + "name": "睽【卦三十八】火泽睽", + "come_from": "离上兑下", + "indicate":[ + "《睽》:小事吉。", + "初九,悔亡。丧马勿逐自复。见恶人无咎。", + "九二,遇主于巷,无咎。", + "六三,见舆曳,其牛掣,其人天且劓,无初有终。", + "九四,睽孤遇元夫,交孚,厉,无咎。", + "六五,悔亡。厥宗噬肤,往何咎?", + "上九,睽孤,见豕负涂,载鬼一车,先张之弧,后说之弧,匪寇婚媾。往遇雨则吉。", + ], + "explain_detail": "" + }, + "001010": { + "name": "蹇【卦三十九】水山蹇", + "come_from": "坎上艮下", + "indicate":[ + "《蹇》:利西南,不利东北。利见大人。贞吉。", + "初六,往蹇来誉。", + "六二,王臣蹇蹇,匪躬之故。", + "九三,往蹇来反。", + "六四,往蹇来连。", + "九五,大蹇朋来。", + "上六,往蹇来硕,吉,利见大人。", + ], + "explain_detail": "" + }, + "010100": { + "name": "解【卦四十】雷水解", + "come_from": "震上坎下", + "indicate":[ + "《解》:利西南。无所往,其来复吉。有攸往,夙吉。", + "初六,无咎。", + "九二,田获三狐,得黄矢,贞吉。", + "六三,负且乘,致寇至,贞吝。", + "九四,解而拇,朋至斯孚。", + "六五,君子维有解,吉,有孚于小人。", + "上六,公用射隼于高墉之上,获之,无不利。", + ], + "explain_detail": "" + }, + "110001": { + "name": "损【卦四十一】山泽损", + "come_from": "艮上兑下", + "indicate":[ + "《损》:有孚,元吉,无咎。可贞,利有攸往。曷之用?二簋可用享。", + "初九,已事遄往,无咎。酌损之。", + "九二,利贞。征凶,弗损,益之。", + "六三,三人行则损一人,一人行则得其友。", + "六四,损其疾,使遄有喜,无咎。", + "六五,或益之十朋之龟,弗克违,元吉。", + "上九,弗损,益之,无咎,贞吉,利有攸往,得臣无家。", + ], + "explain_detail": "" + }, + "100011": { + "name": "益【卦四十二】风雷益", + "come_from": "巽上震下", + "indicate":[ + "《益》:利有攸往。利涉大川。", + "初九,利用为大作,元吉,无咎。", + "六二,或益之十朋之龟,弗克违。永贞吉。王用享于帝,吉。", + "六三,益之用凶事,无咎。有孚。中行告公用圭。", + "六四,中行告公,从,利用为依迁国。", + "九五,有孚惠心,勿问,元吉。有孚,惠我德。", + "上九,莫益之,或击之,立心勿恒,凶。", + ], + "explain_detail": "" + }, + "111110": { + "name": "夬【卦四十三】泽天夬", + "come_from": "兑上乾下", + "indicate":[ + "《夬》:扬于王庭,孚号。有厉,告自邑。不利即戎,利有攸往。", + "初九,壮于前趾,往不胜,为咎。", + "九二,惕号,莫夜有戎,勿恤。", + "九三,壮于頄,有凶。君子夬夬独行,遇雨若濡,有愠无咎。", + "九四,臀无肤,其行次且。牵羊悔亡,闻言不信。", + "九五,苋陆夬夬中行,无咎。", + "上六,无号,终有凶。", + ], + "explain_detail": "" + }, + "011111": { + "name": "姤【卦四十四】天风姤", + "come_from": "乾上巽下", + "indicate":[ + "《姤》:女壮,勿用取女。", + "初六,系于金柅,贞吉。有攸往,见凶,羸豕孚蹢躅。", + "九二,包有鱼,无咎,不利宾。", + "九三,臀无肤,其行次且,厉,无大咎。", + "九四,包无鱼,起凶。", + "九五,以杞包瓜,含章,有陨自天。", + "上九,姤其角,吝,无咎。", + ], + "explain_detail": "" + }, + "000110": { + "name": "萃【卦四十五】泽地萃", + "come_from": "兑上坤下", + "indicate":[ + "《萃》:亨,王假有庙。利见大人。亨,利贞,用大牲吉。利有攸往。", + "初六,有孚不终,乃乱乃萃,若号,一握为笑,勿恤,往无咎。", + "六二,引吉,无咎,孚乃利用禴。", + "六三,萃如嗟如,无攸利,往无咎,小吝。", + "九四,大吉无咎。", + "九五,萃有位,无咎。匪孚,元永贞,悔亡。", + "上六,赍咨涕洟,无咎。", + ], + "explain_detail": "" + }, + "011000": { + "name": "升【卦四十六】地风升", + "come_from": "坤上巽下", + "indicate":[ + "《升》:元亨。用见大人,勿恤。南征吉。", + "初六,允升,大吉。", + "九二,孚乃利用禴,无咎。", + "九三,升虚邑。", + "六四,王用亨于岐山,吉,无咎。", + "六五,贞吉,升阶。", + "上六,冥升,利于不息之贞。", + ], + "explain_detail": "" + }, + "010110": { + "name": "困【卦四十七】泽水困", + "come_from": "兑上坎下", + "indicate":[ + "《困》:亨。贞大人吉,无咎。有言不信。", + "初六,臀困于株木,入于幽谷,三岁不觌。", + "九二,困于酒食,朱绂方来。利用享祀。征凶,无咎。", + "六三,困于石,据于蒺藜,入于其宫,不见其妻,凶。", + "九四,来徐徐,困于金车,吝,有终。", + "九五,劓刖,困于赤绂,乃徐有说,利用祭祀。", + "上六,困于葛藟,于臲<臬兀>,曰动悔有悔,征吉。", + ], + "explain_detail": "" + }, + "011010": { + "name": "井【卦四十八】水风井", + "come_from": "坎上巽下", + "indicate":[ + "《井》:改邑不改井,无丧无得。往来井井。汔至,亦未繘井,羸其瓶,凶。", + "初六,井泥不食。旧井无禽。", + "九二,井谷射鲋,瓮敝漏。", + "九三,井渫不食,为我心恻。可用汲,王明并受其福。", + "六四,井甃,无咎。", + "九五,井洌,寒泉食。", + "上六,井收勿幕,有孚元吉。", + ], + "explain_detail": "" + }, + "101110": { + "name": "革【卦四十九】泽火革", + "come_from": "兑上离下", + "indicate":[ + "《革》:已日乃孚。元亨。利贞,悔亡。", + "初九,巩用黄牛之革。", + "六二,巳日乃革之,征吉,无咎。", + "九三,征凶。贞厉。革言三就,有孚。", + "九四,悔亡。有孚改命,吉。", + "九五,大人虎变,未占有孚。", + "上六,君子豹变,小人革面,征凶,居贞吉。", + ], + "explain_detail": "" + }, + "011101": { + "name": "鼎【卦五十】火风鼎", + "come_from": "离上巽下", + "indicate":[ + "《鼎》:元吉,亨。", + "初六:鼎颠趾,利出否,得妾以其子,无咎。", + "九二:鼎有实,我仇有疾,不我能即,吉。", + "九三:鼎耳革,其行塞,雉膏不食,方雨亏悔,终吉。", + "九四:鼎折足,覆公餗,其形渥,凶。", + "六五:鼎黄耳金铉,利贞。", + "上九:鼎玉铉,大吉,无不利。", + ], + "explain_detail": "" + }, + "100100": { + "name": "震【卦五十一】震为雷", + "come_from": "震上震下", + "indicate":[ + "《震》:亨。震来虩虩,笑言哑哑,震惊百里,不丧匕鬯。", + "初九,震来虩虩,后笑言哑哑,吉。", + "六二,震来厉,亿丧贝,跻于九陵,勿逐,七日得。", + "六三,震苏苏,震行无眚。", + "九四,震遂泥。", + "六五,震往来,厉,意无丧,有事。", + "上六,震索索,视矍矍,征凶。震不于其躬,于其邻,无咎。婚媾有言。", + ], + "explain_detail": "" + }, + "001001": { + "name": "艮【卦五十二】艮为山", + "come_from": "艮上艮下", + "indicate":[ + "《艮》:艮其背,不获其身,行其庭,不见其人,无咎。", + "初六,艮其趾,无咎。利永贞。", + "六二,艮其腓,不拯其随,其心不快。", + "九三,艮其限,列其夤,厉,熏心。", + "六四,艮其身,无咎。", + "六五,艮其辅,言有序,悔亡。", + "上九,敦艮,吉。", + ], + "explain_detail": "" + }, + "001011": { + "name": "渐【卦五十三】风山渐", + "come_from": "巽上艮下", + "indicate":[ + "《渐》:女归吉,利贞。", + "初六,鸿渐于干。小子厉,有言,无咎。", + "六二,鸿渐于磐,饮食衎衎,吉。", + "九三,鸿渐于陆。夫征不复,妇孕不育,凶。利御寇。", + "六四,鸿渐于木,或得其桷,无咎。", + "九五,鸿渐于陵,妇三岁不孕,终莫之胜,吉。", + "上九,鸿渐于陆,其羽可用为仪,吉。", + ], + "explain_detail": "" + }, + "110100": { + "name": "归妹【卦五十四】雷泽归妹", + "come_from": "震上兑下", + "indicate":[ + "《归妹》:征凶,无攸利。", + "初九,归妹以娣。跛能履,征吉。", + "九二,眇能视,利幽人之贞。", + "六三,归妹以须,反归以娣。", + "九四,归妹愆期,迟归有时。", + "六五,帝乙归妹,其君之袂不如其娣之袂良。月几望,吉。", + "上六,女承筐无实,士刲羊无血,无攸利。", + ], + "explain_detail": "" + }, + "101100": { + "name": "丰【卦五十五】雷火丰", + "come_from": "震上离下", + "indicate":[ + "《丰》:亨,王假之。勿忧,宜日中。", + "初九,遇其配主,虽旬无咎,往有尚。", + "六二,丰其蔀,日中见斗。往得疑疾,有孚发若,吉。", + "九三,丰其沛,日中见沫,折其右肱,无咎。", + "九四,丰其蔀,日中见斗,遇其夷主,吉。", + "六五,来章有庆誉,吉。", + "上六,丰其屋,蔀其家,窥其户,阒其无人,三岁不觌,凶。", + ], + "explain_detail": "" + }, + "001101": { + "name": "旅【卦五十六】火山旅", + "come_from": "离上艮下", + "indicate":[ + "《旅》:小亨。旅贞吉。", + "初六,旅琐琐,斯其所取灾。", + "六二,旅即次,怀其资,得童仆,贞。", + "九三,旅焚其次,丧其童仆,贞厉。", + "九四,旅于处,得其资斧,我心不快。", + "六五,射雉,一矢亡,终以誉命。", + "上九,鸟焚其巢,旅人先笑后号啕。丧牛于易,凶。", + ], + "explain_detail": "" + }, + "011011": { + "name": "巽【卦五十七】巽为风", + "come_from": "巽上巽下", + "indicate":[ + "《巽》:小亨。利有攸往。利见大人。", + "初六,进退,利武人之贞。", + "九二,巽在床下,用史巫纷若,吉,无咎。", + "九三,频巽,吝。", + "六四,悔亡,田获三品。", + "九五,贞吉,悔亡,无不利,无初有终。先庚三日,后庚三日,吉。", + "上九,巽在床下,丧其资斧,贞凶。", + ], + "explain_detail": "" + }, + "110110": { + "name": "兑【卦五十八】兑为泽", + "come_from": "兑上兑下", + "indicate":[ + "《兑》:亨。利贞。", + "初九,和兑,吉。", + "九二,孚兑,吉,悔亡。", + "六三,来兑,凶。", + "九四,商兑未宁,介疾有喜。", + "九五,孚于剥,有厉。", + "上六,引兑。", + ], + "explain_detail": "" + }, + "010011": { + "name": "涣【卦五十九】风水涣", + "come_from": "巽上坎下", + "indicate":[ + "《涣》:亨。王假有庙。利涉大川,利贞。", + "初六,用拯马壮,吉。", + "九二,涣奔其机,悔亡。", + "六三,涣其躬,无悔。", + "六四,涣其群,元吉。涣有丘,匪夷所思。", + "九五,涣汗其大号,涣王居,无咎。", + "上九,涣其血,去逖出,无咎。", + ], + "explain_detail": "" + }, + "110010": { + "name": "节【卦六十】水泽节", + "come_from": "坎上兑下", + "indicate":[ + "《节》:亨。苦节,不可贞。", + "初九,不出户庭,无咎。", + "九二,不出门庭,凶。", + "六三,不节若,则嗟若,无咎。", + "六四,安节。亨。", + "九五,甘节,吉,往有尚。", + "上六,苦节,贞凶,悔亡。", + ], + "explain_detail": "" + }, + "110011": { + "name": "中孚【卦六十一】风泽中孚", + "come_from": "巽上兑下", + "indicate":[ + "《中孚》:豚鱼,吉。利涉大川,利贞。", + "初九,虞吉,有它不燕。", + "九二,鸣鹤在阴,其子和之。我有好爵,吾与尔靡之。", + "六三,得敌,或鼓或罢,或泣或歌。", + "六四,月几望,马匹亡,无咎。", + "九五,有孚挛如,无咎。", + "上九,翰音登于天,贞凶。", + ], + "explain_detail": "" + }, + "001100": { + "name": "小过【卦六十二】雷山小过", + "come_from": "震上艮下", + "indicate":[ + "《小过》:亨。利贞。可小事,不可大事。飞鸟遗之音,不宜上,宜下,大吉。", + "初六,飞鸟以凶。", + "六二,过其祖,遇其妣。不及其君,遇其臣。无咎。", + "九三,弗过防之,从或戕之,凶。", + "九四,无咎。弗过遇之,往厉必戒,勿用永贞。", + "六五,密云不雨,自我西郊。公弋取彼在穴。", + "上六,弗遇过之,飞鸟离之,凶,是谓灾眚。", + ], + "explain_detail": "" + }, + "101010": { + "name": "既济【卦六十三】水火既济", + "come_from": "坎上离下", + "indicate":[ + "《既济》:亨小,利贞。初吉终乱。", + "初九,曳其轮,濡其尾,无咎。", + "六二,「妇丧其茀,勿逐,七日得。", + "九三,高宗伐鬼方,三年克之,小人勿用。", + "六四,繻有衣袽,终日戒。", + "九五,东邻杀牛,不如西邻之禴祭,实受其福。", + "上六,濡其首,厉。", + ], + "explain_detail": "" + }, + "010101": { + "name": "未济【卦六十四】火水未济", + "come_from": "离上坎下", + "indicate":[ + "《未济》:亨。小狐汔济,濡其尾,无攸利。", + "初六,濡其尾,吝。", + "九二,曳其轮,贞吉。", + "六三,未济,征凶。利涉大川。", + "九四,贞吉,悔亡,震用伐鬼方,三年,有赏于大国。", + "六五,贞吉,无悔。君子之光,有孚吉。", + "上九,有孚于饮酒,无咎。濡其首,有孚失是。", + ], + "explain_detail": "" + } +}