This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER in your comment with the same courtesy that I will give you. Its very hard to reply intelligibly without some background of the correspondent. Thanks,gold

The Iching is the ancient fortune telling book of China. The Iching literature mentions various methods for casting fortune patterns of Iching. The various methods include hot ironing of turtle shells (-t.), manipulations of yarrow sticks, flipping coins, throwing shaman bones, and dice. One analogy from North America is a shaman throwing or shuffling stick dice.

I made three stick dice for Iching by cutting a dowel of square cross section into three sticks. For the three stick dice, the flat sides are marked or burned with 2 or 3 holes alternately. Two sticks are marked with {3 2 3 2} dots on the sides. One stick is marked with {3 3 3 2} dots on the sides. In casting such three dice, the possible sums are 6,7,8, or 9. Further, the stick dice are cast six times to obtain whole lines or broken lines in a pattern or set of six lines. A set of six Iching lines is called a gua in the orient or a hexagram in some translations of the Chinese.

In the Iching interpretations, casts of 6 and 8 are broken or yin (female) lines, while casts of 7 and 9 are whole or yang (male) lines. The casts are recorded by pencil with the first line at bottom and marking up the column. It is possible to record the numbers from the casts with tally sticks or Chinese counting rods, which are somewhat reminiscent of the Iching patterns themselves. After marking the original pattern or hexagram, sometimes a second follow-up hexagram is developed by swapping throws of 6 for a 7 and throws of 9 for a 6. These swaps effectively trade a broken line(6) for a whole line(7) and a whole line(9) for a broken line(6). The throws for the changing lines (6&9) may not always be come out in the first hexagram or its component lines, so the followup hexagram may not exist {under consistent rules}. If the first hexagram is interpreted on a line by line basis, any changing lines(6&9) or second hexagram offers some modification or discount on the interpretation of the first hexagram.

In developing a computer program or application, it is helpful to develop analogs for the individual tasks of the application. An Iching application would have to compose, beg, or borrow TCL procedures for random casts, tallies of scores, accounting files, display hexagram lines on a screen, swapping changing lines, hexagram pattern recognition and ranking interpretations. In fact, some TCL one liner procedures and text swapping routines might be useful as utilities in a starter application program, since unruly text strings are expected in the Iching. Casting the sticks or bones for each Iching line is analog for random lpick subroutine below. Adding the top sides of three sticks and throwing six times is analog for the "for 6 times" statement in the bonereadxx procedure below. In the West, Leibniz etc recognized that the whole and broken lines in the hexagram patterns could be counted as ones and zeros, respectively in a binary number system. For example, a cast or TCL list of { 6,7,8,9,6,7 } could be expressed as a binary number, 010101. The binary numbers are the analogs for the binaryexchange subroutine below. For computer procedures, the patterns are effectively a horizontal bar code of 6 lines.

In the process of designing the basic subroutine tasks, we could throw in some switches, logic chains, or daisy chains that break the outset rules given above. For example, TCL is so good at swapping lines (6&9) for the second hexagram, that it would be easy to put a switch that generates or swaps all hexagram lines (6,7,8,&9) for their opposites. Also from some scripts of the Chinese Chou dynasty, different Iching fortune methods of yarrow sticks or coins would generate different probabilities of obtaining each hexagram line. Might be interesting to have a back door in the program to check (or adapt} the different probabilities of stick or coin throws. Several authors have pointed out that a few of the hexagrams look similar to Chinese characters or even Mayan calendar notation. Without wading too deep into alternate realities, the Iching hexagrams could be used as numerals, script alphabet, game tokens, symbol recognition code, or maybe a programming language (like Greek letters for APL operators). Such rule breaking helps keep the finished program more flexible.