I Ching Simulator
castiching.comKey Features
Tech Stack
Key Features
Tech Stack
I just identified the issue (it was a specific mobile browser compatibility bug). I have deployed a hotfix and it should be working now on iOS.
Could you please give it another try? Sorry for the trouble!
To be honest, I haven't added it because I'm hesitating. I planned to use AI to generate the interpretations, but I'm not sure if that's a good idea.
I feel like letting AI explain the I Ching might kill the 'traditional vibe'.
I'm still deciding: should I use AI, or just use the classic book text? What do you think?
I probably stared at it for too long on my own monitor and got used to it. I will bump up the contrast in the next update to ensure it's readable for everyone.
https://www.urbandictionary.com/define.php?term=A+Suffusion+...
I recommend buying the book though. It is fascinating whether or not you buy into it.
I guess it's a question of philosophy, either split into groups based off of your intuition, or aim for a truly random split in the pile.
Anyway, I wasn't sure if this is something that's a settled matter or what.
Yeah I just mean I would be very conscious of splitting with a single stalk in one group and would wonder if that was really a 'fair' selection or something I did intentionally since I know the exact number of the yarrow in one hand. In practice, I can't imagine anyone would make a selection like that, even though in a truly random system it would happen not infrequently.
You are right that humans don't split perfectly randomly (Uniform Distribution). We tend to aim for the middle but miss slightly.
In my code, I modeled this 'human splitting action' using a Gaussian (Normal) distribution centered at 50% of the pile, with a standard deviation. This simulates the user trying to split the stalks roughly in half, rather than just picking a random number from 0 to 49.
Interestingly, my Monte Carlo simulations showed that even with this human bias (splitting near the middle), the final modulo-4 probabilities remain stable. So the algorithm is robust even against our 'imperfect' hands.
Speaking of 'neatness', I just pushed an update that lets you generate a visual Result Card of your reading.
So now you can get a nice downloadable souvenir of that Gaussian-distributed hexagram. :D
Have you built a web app or a mobile app? I'd love to check out your work if you have a link!
My I Ching tool is located at classicofchanges.com
I checked out your site—having the full index on a single page is actually super handy for quick referencing.
And I totally relate to the 'Vanilla JS vs Framework' struggle. I ended up choosing Next.js precisely because managing the state for the complex probabilities (6/7/8/9) was giving me a headache. Respect for sticking to the raw math!
It is really cool to see how different developers interpret the same ancient text. I noticed your approach is very direct and efficient with the results.
Keep going!
It got tiring and boring to click and click and click with the mouse with no explanation for how it works
Original Hexagram 45. GATHERING TOGETHER (MASSING) (Ts'ui)
Transformed Hexagram 17. FOLLOWING (Sui)
Ok.
My interpretation for your power supply:
Gathering (45): You need to gather some capacitors? (or maybe a heat sink for the 'massing'?)
Following (17): Clearly it's telling you to use a Voltage Follower. :D
To be honest, my reason for picking this method was simple: I was reading a book about the I Ching that described the different ways to cast hexagrams.
The Yarrow Stalk method stood out to me because it felt more mysterious—in the past, it seemed like a secret method known only by a few experts.
Also, from a coding perspective, this algorithm was just much more interesting to build than a simple coin toss!
A fundamental part of I Ching reading is the implication that each present state is in the process of transforming to another.
Since you have experience with the actual stalks, I think you'll like the update I just pushed: I’ve fully integrated the classic Wilhelm/Baynes text to ensure the reading has that authentic, traditional grounding you mentioned.
I also added a way to generate a visual card of the result—trying to bring back a bit of that 'tangible artifact' feel of the physical ritual. :)
You are raising a critical UX issue. Currently, I haven't implemented user accounts or a database because I wanted to keep the app simple and login-free.
However, that shouldn't mean losing your data on a refresh! I will prioritize a fix using Local Storage so your current reading persists even if you hit the back button.
I'll also make the result link much more obvious so you don't have to hunt for it. Really appreciate you trying it out despite the rough edges!
_____ (black bar, 7)
_____ (black bar, 7)
__.__ (grey bar, marked by green dot in the middle, 9)
__ __ (two short black bars with gap in the middle, 8)
__.__ (grey bar, marked by green dot in the middle, 9)
__ __ (two short black bars with gap in the middle, 8)
Primary Hexagram 6. CONFLICT (Sung)
Relating Hexagram 20. CONTEMPLATION (Kuan)
Reverse engineer the question :->
You were likely asking: 'Why is this code throwing an error and fighting me?'
The transition from Conflict (fighting the code) to Contemplation (Observing/Viewing) suggests the solution isn't to type more code, but to step away and look at the logs (or the documentation).
Did I debug the user intent correctly?
It’s rare, but both of your moving lines start with the exact same verdict: 'One cannot engage in conflict' (不克讼).
Line 2 says: Retreat and return home. (Don't fight the reality.)
Line 4 says: Turn back and submit to fate. (Acceptance brings peace.)
The Oracle seems to be validating your feeling of loss, but advising that this isn't a battle to be won against time (Conflict). It’s a transition to be understood.
You are moving from Hexagram 6 (Fighting) to Hexagram 20 (Contemplation/Viewing). The 'supernatural power' of youth is active energy; the power of age is perspective. You aren't losing the code, you're just moving from 'Writing' to 'Architecting'. :)
Shortly after that I rejuvenated some old nun, 90+, eaten up by cancer, waiting to die under morphines. Invited by the then acting chief nun, after she caught me having sex with some of the girls they housed, and watched over. And I explained myself, that she shouldn't damn me, they should feel blessed by my touch. As could be seen by the smile of one of them, whole again, because before one frontal tooth was broken off halfways. Also slimmed down her belly and hips a little :-) So she took me by words, and I 'delivered'. I made that old nun free of cancer, and returned her to about 25 years of biological age, with all her memories still intact, and not addicted to morphine, clear minded. Very sexy. Which in turn led to a little celebration, and an orgy in their chapel. Which a few days later led to a meeting with some Jesuits near there, where they lived in cozy appartments below the ruins of an old castle tower. Why? Because one of the assholes tried to excorcise the devil out of me. Which ended very bad for him, but I healed him too, after I messed him up, to be my messenger to the pope, or whoever is pulling the strings in the Vatican. Message more or less:"I'm back, and I really don't like your ways! Change, or else...!" I still don't like their ways, btw. Though they changed a little, mainly opening their archives which is very important to me!
Anyway, much sex ensued, most just joyful with sweet girls of my age, some slightly older, but still young woman, sometimes in orgies again, sometimes healing and/or rejuvenating them. Left my home. Fuckery continued in several places, sometimes in orgies. Where sometimes some supernaturalness ensued again during said fuckery.
Moved on, tried to live a more normal life, got experience in several fields. Wasn't really for me, could be considered a failure. Moved on several times again.
'Invented' something technical, but not really, was just a rehash of old ideas, brought up to current technological standards, and combined where it made sense. With patents long expired, some not so long, but still.
That got noticed, and so I've been snatched up to where I am now, by ways of which I'm not at liberty to talk about :-)
With all that said, I don't see why I should turn back home and submit to fate? What would that even be? I've been 40+ years gone from there.
I live very well where I am now, have cats, sexy women, (legal)drugs, am healthy. Just lacking the supernaturalness.
I spent the last 24 hours implementing the feedback from this thread. Thank you all for the harsh (but fair) critique.
1. Ditched AI for the Classics Many of you pointed out that AI interpretations felt "soulless" or risky. I agreed.
Now: The app directly displays the canonical Richard Wilhelm / Cary Baynes translation (Foreword by Carl Jung) for the Primary Hexagram, Moving Lines, and the Relating Hexagram. It's mathematically precise and respects the source material.
2. No More Lost Readings (Persistence) @jmkd mentioned losing a reading on refresh.
Fix: The latest reading is now auto-saved to Local Storage.
Privacy: Still no login required. Your data stays in your browser.
3. Shareable "Result Cards" Since the hexagrams look so cool, I added a feature to generate a downloadable image card. It captures the visual pattern and the key judgment text.
Give it another spin and let me know if the "Moving Lines" logic feels right to you now!
I built this because I wanted a digital I Ching that honors the original math, rather than just Math.random().
Technical Detail for the Curious: The simulation follows the traditional Yarrow Stalk algorithm (Da Yan). The core of this algorithm relies on modulo-4 arithmetic on the stalks remaining after a random split.
To make it physically realistic, I used a Box-Muller transform to simulate the user splitting the stalks with a Gaussian distribution (since humans naturally tend to split near the middle), rather than a uniform random split.
I was worried this 'human bias' might skew the modulo probabilities, so I ran a 1-million-run Monte Carlo simulation to verify.
The Result: The remainders [0,1,2,3] still emerged with a near-perfect 25% distribution (deviation < 0.05%).
So, the app simulates the physics of human imperfection while preserving the mathematical perfection of the probability distribution (where Old Yin is 1/16).
Stack: Next.js + Tailwind css
Happy to answer any questions about the math or the hexagrams!
Not affiliated with Hacker News or Y Combinator. We simply enrich the public API with analytics.