This is a JavaScript toolkit for the ancient Chinese I Ching divination system.
The divination method is taken from the manual to an old Amiga game, Windwalker.
It provides a method for generating a reading (without interpretation), and mapping tools for converting between I Ching monograms, trigrams and hexagrams as Unicode characters.
To generate a reading:
const IChing = require('i-ching');
IChing.getReading();
// { hexagram: '䷃' }
IChing.getReading();
// { hexagram: '䷱', changedHexagram: '䷕' }
To convert between symbols:
IChing.Symbols.Monograms
// ['⚊','⚋']
IChing.Symbols.TrigramForMonograms['⚊⚋⚊']
// '☲'
IChing.Symbols.MonogramsForTrigram['☲']
// '⚊⚋⚊'
IChing.Symbols.HexagramForTrigrams['☰☵']
// '䷄'
IChing.Symbols.TrigramsForHexagram['☴☶']
// '䷑'
Note that the symbols are stacked bottom to top, so the first symbol appears under the second one, as per the I Ching convention.