预言机是一个二进制系统。事实上,今天运行每台数字设备的 1 和 0 数学的灵感都来源于此。不过,算命源码使用虚线和实线代替了 1 和 0。通过一系列随机操作,最常见的是抽签或抛硬币,产生六条断线和不间断线的图案,构成 64 个卦中的一个,每个卦描述一个特定的情况或条件,以及一组用于解释的文本. 除了断线或未断线之外,一条线可能在变化或不变的过渡,反之亦然。
算命源码及演示:m.appwin.top
源码示例:ching.js
var Stalks = 50;
var HandPile;
var EastPile;
var WestPile;
var EastRemainder;
var WestRemainder;
var CountValue1;
var CountValue2;
var CountValue3;
var LineValue;
var asciipic;
var DivideStalks = function(YarrowStalks){
// Divide 49 stalks into eastpile westpile
// Subtract one from westpile put in handpile
WestPile = Math.floor((Math.random() * YarrowStalks) + 1);
EastPile = YarrowStalks - WestPile;
WestPile = WestPile - 1;
HandPile = 1;
}
var DivideEastAndWest = function(){
EastRemainder = (EastPile % 4);
WestRemainder = (WestPile % 4);
if (EastRemainder == 0) EastRemainder = 4;
if (WestRemainder == 0) WestRemainder = 4;
HandPile = HandPile + EastRemainder + WestRemainder;
}
var LineCast = function(){
//This function creates the pictures of lines as broken or unbroken
//and changing or unchanging
Stalks = 49; //Remove one stalk and set it aside
DivideStalks(Stalks);
// Divide 49 Yarrow stalks into two piles at random: East and West
// Subtract a single stalk from the West and put it in your hand
// between