Last active
April 22, 2020 20:18
-
-
Save alexkuang0/1e911682f9554ab224b433ad9874c1a9 to your computer and use it in GitHub Desktop.
Calculate Hexagram for Ancient Chinese divination. (易经六十四卦)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
results = [] | |
for i in range(0,6): | |
sum = 0 | |
for i in range(0,3): | |
sum += randint(2, 3) | |
results.append(sum) | |
for res in reversed(results): | |
if res % 2 == 0: | |
print("- -") # Yin | |
if res % 2 == 1: | |
print("---") # Yang |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please use
python3
to run this code.