1 .\" $NetBSD: ching.6,v 1.1 2005/06/30 13:30:33 perry Exp $
3 .\" Copyright (c) Caldera International Inc. 2001-2002. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code and documentation must retain the
10 .\" above copyright notice, this list of conditions and the following
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed or owned by Caldera
18 .\" International, Inc.
19 .\" 4. Neither the name of Caldera International, Inc. nor the names of
20 .\" other contributors may be used to endorse or promote products
21 .\" derived from this software without specific prior written permission.
23 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
24 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
25 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 .\" DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
28 .\" FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 .\" Copyright (c) 1993
38 .\" The Regents of the University of California. All rights reserved.
40 .\" Redistribution and use in source and binary forms, with or without
41 .\" modification, are permitted provided that the following conditions
43 .\" 1. Redistributions of source code must retain the above copyright
44 .\" notice, this list of conditions and the following disclaimer.
45 .\" 2. Redistributions in binary form must reproduce the above copyright
46 .\" notice, this list of conditions and the following disclaimer in the
47 .\" documentation and/or other materials provided with the distribution.
48 .\" 3. Neither the name of the University nor the names of its contributors
49 .\" may be used to endorse or promote products derived from this software
50 .\" without specific prior written permission.
52 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
53 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
56 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
65 .\" @(#)ching.6 8.1 (Berkeley) 5/31/93
72 .Nd the book of changes and other cookies
81 is an ancient Chinese oracle that has been in use for centuries
82 as a source of wisdom and advice.
86 (as it is sometimes known) consists of sixty-four
88 each symbolized by a particular arrangement of six straight (\-\-\-)
89 and broken (\-\ \-) lines. These lines have values ranging
90 from six through nine, with the even values indicating the broken lines.
92 Each hexagram consists of two major sections. The
94 relates specifically to the matter at hand
96 .Dq "It furthers one to have somewhere to go."
100 describes the general attributes of the hexagram and how they apply
102 .Po Do Thus the superior man makes
104 .No and untiring. Dc Pc
105 When any of the lines have the values six or nine, they are moving
106 lines; for each there is an appended judgement which becomes
107 significant. Furthermore, the moving lines are inherently unstable
108 and change into their opposites; a second hexagram (and thus an
109 additional judgement) is formed.
111 Normally, one consults the oracle by fixing the desired question
112 firmly in mind and then casting a set of changes (lines)
113 using yarrow\-stalks or tossed coins. The resulting hexagram
114 will be the answer to the question.
116 Using an algorithm suggested by S. C. Johnson, the
119 simply reads a question from the standard input (up to an EOF) and
120 hashes the individual characters in combination with the time of day,
121 process id and any other magic numbers which happen to be lying around
122 the system. The resulting value is used as the seed of a random
123 number generator which drives a simulated coin\-toss divination. The
124 answer is then piped through
126 for formatting and will appear on the standard output.
128 For those who wish to remain steadfast in the old traditions, the
129 oracle will also accept the results of a personal divination using,
130 for example, coins. To do this, cast the change and then type the
131 resulting line values as an argument.
133 The impatient modern may prefer to settle for Chinese cookies; try
136 It furthers one to see the great man.
138 The great prince issues commands,
140 Founds states, vests families with fiefs.
142 Inferior people should not be employed.
146 Brings about the arrival of the enemy.
148 If one is not extremely careful,
150 Somebody may come up from behind and strike him.