I Ching, cast in Hazel

Hazel activities › ancient oracles · source on GitHub · hazeljs on npm

Ask a question, then cast six lines, one at a time, from the bottom up: by three coins, or by dividing the yarrow stalks. Each line is cast by a Hazel program, shown beside the reading as text, or in Hazel's own editor at the press of a button; the page only passes it random numbers and draws what comes back. Change the program and the page builds it again. While it has an error or a hole, the page's own JavaScript casts instead, and each line says which did.

Cast by
⏳ Loading Hazel (hazeljs from jsDelivr); until then the page's own JS casts.

A new reading

Six lines, cast from the bottom.

    This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).

    The vocabulary every module sees (i-ching/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor (about 7 MB each), where Ctrl+click on a name, or F12, goes to its definition; Show as text goes back, your edits kept.

    loading preamble.hz…
    Lines a line's value, which lines change, and what they turn into
    loading Lines.hz…
    Casting three coins, or three divisions of the yarrow stalks
    loading Casting.hz…
    Book the eight trigrams and the 64 hexagrams, in the King Wen order
    loading Book.hz…
    Reading the reading so far, from the lines cast. The page calls (cast = Casting.cast, reading = Reading.reading).
    loading Reading.hz…

    hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words) · by Matthew Hammer · an example for hazeljs