I developed a ruby library to generate hexagrams using the yarrow-stalk algorithm outlined in the appendix of Richard Wilhem's translation of the Chinese I-Ching ("Book of Changes").
The library supports the following features:
The ruby I-Ching Casting library is available for download from my Github account.
The code is offered under the MIT license.
Unsatisfied with the ASCII representation of hexagrams, I developed a visualization of the hexagrams using JRuby Processing. This visualization may be run within a web browser or as a stand-alone application.
If your browser supports Java plugins, try the visualization now.