Skip to content

JavaScript implementation of the I Ching divination method

Notifications You must be signed in to change notification settings

hermetechnics/i-ching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

i-ching

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.

Usage

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.

About

JavaScript implementation of the I Ching divination method

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published